Object short-hand
Key name & value name must be same
_8const age = 20;_8const stream = "Aeronautical";_8_8const student = {_8 name: "APJ",_8 age: age,_8 stream: stream,_8};
Above could be shortened as below
_5const student = {_5 name: "APJ",_5 age,_5 stream,_5};
If the keys & value are not same like score
& mark
then you have mention both otherwise it will Result in error
_9const age = 20;_9const stream = "Aeronautical";_9const mark = 90;_9const student = {_9 name: "APJ",_9 age,_9 stream,_9 score: mark,_9};
Error - โ
_9const age = 20;_9const stream = "Aeronautical";_9const mark = 90;_9const student = {_9 name: "APJ",_9 age,_9 stream,_9 score,_9};
@ragavkumarv
swipe to next โก๏ธ