Home > Blockchain >  how can i get key and value from a object of array
how can i get key and value from a object of array

Time:08-12

enter code here const tempList = [ { id: 1, name: 'Abdullah', }, { id: 2, value: 'Just checking', }, { flag: 'yes', checking: 'here', }, { numberofitems: '56', tree: 'green', checking: 'again', rightHere: 'First time', }, { yellow: 'green', Off: 'again', lefthere: 'First time', }, { again: 'green', checking: 'again', rightHere: 'First time', }, { numberofitems: 98, tree: 'green', checking: 'again', }, { tree: 'yellow', checking: 'once again', rightHere: 'First time', }, { numberofitems: 556, tree: 'green', checking: 'again', }, { numberofitems: 'testing again', }, { checkingOnceAgain: 'again', rightHere: 'First time', }, { tree: 'green', rightHere: 'First time', }, { tree: 'yellow', rightHere: 'First time', }, { checking: 'again', rightHere: 'yr time', }, { numberofitems: 56, tree: 'green', checking: 'again', rightHere: 'First time', }, { tree: 'green', checking: 'again', rightHere: 'First time', }, { tree: 'last on', checking: 'yeah baby', rightHere: 'last time', }, ];

CodePudding user response:

You should use names according to their use.

Bad Practice:-

let string = "Some Random Name"

Good Practice

let name = "Some Random Name"

In the above example you can see that I have used naming convention that itself defines its use.

CodePudding user response:

For naming convention is most powerful things when other people review your code.

What we are following? => We provide class / Methods name base on "features" name.

Example, When we develop login features, and have to render "InputField" it's called "renderInputField".

Maybe above things helpful for you.

  • Related