I’d like to get the numeric value of the object ‘add_ele’ from the following result using NodeJS, can somebody please show me how?
[
{ code: 'switch', value: true },
{ code: 'countdown_1', value: 0 },
{ code: 'add_ele', value: 151800 },
{ code: 'cur_current', value: 0 },
{ code: 'cur_power', value: 0 },
{ code: 'cur_voltage', value: 2140 },
{ code: 'test_bit', value: 0 },
{ code: 'voltage_coe', value: 0 },
{ code: 'electric_coe', value: 0 },
{ code: 'power_coe', value: 0 },
{ code: 'electricity_coe', value: 0 },
{ code: 'fault', value: 0 },
{ code: 'relay_status', value: 'last' },
{ code: 'child_lock', value: false }
]
I have not been able to fins a way to do this so far
2
Answers
welcome to stackoverflow.
You can try this code.
Method 1:
Method 2: