Answer the question
In order to leave comments, you need to log in
How to properly get data from an object?
{"getuserworkersinfo":{"version":"1.0.0","data":{
"0":{"user":"ole.1","tag":"LD","rate":0,"auto":0},
"1":{"user":"ole.2","tag":"LD","rate":0,"auto":0},
"2":{"user":"ole.3","tag":"LD","rate":0,"auto":0},
"3":{"user":"ole.4","tag":"LD","rate":0,"auto":0},
"4":{"user":"ole.5","tag":"LD","rate":0,"auto":0},
"5":{"user":"ole.6","tag":"LD","rate":0,"auto":0},
"6":{"user":"ole.7","tag":"LD","rate":0,"auto":0}}}}
Answer the question
In order to leave comments, you need to log in
const { data } = response.getuserworkersinfo;
const targetUser = Object.values(data).find(({ user }) => user === 'ole.5');
const { rate } = targetUser;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question