While doing destructring in JavaScript, varable should be same as property name of an object? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

While doing destructring in JavaScript, varable should be same as property name of an object?

Please See the code here. https://code.sololearn.com/W85bxXmy98HU/?ref=app

3rd Mar 2019, 2:16 AM
Chandra Sekhar Ravuri
Chandra Sekhar Ravuri - avatar
1 Resposta
+ 1
It's not mentioned explicitly here in ES6 section of JS course but it seems so. BTW, if you want to use another variable, you can do something like let {h:a, s:b} = obj; console.log(a) console.log(b)
3rd Mar 2019, 2:31 AM
ŠØŠ°Ń‰Šø Š Š°Š½Š¶Š°Š½
ŠØŠ°Ń‰Šø Š Š°Š½Š¶Š°Š½ - avatar