We cannot assign any values ββto any literals, such as an array, object, string.
for example: [a] = [1];
{a} = {1};
"a" = "b";
But we can assign a value using a comma delimiter
[a], {a} = {a: 1};
Output:
[a] - [1]
{a} - {a: 1}
Note:
Literal 1.Object should not be the first in initialization.
2. No values ββare ever stored in a string literal.
() - qualto return statement
Whatever you specify in {} , it will automatically execute itself;
To simply install the {return;} code anywhere in the function, it will return the function.
Just take a look at the code succinct for understanding.
var a =5;b=6; console.log(JSON.stringify({a,b}));
source share