We can't assign any values to any literals like array,object,string.
ex:
[a] = [1];
{a} = {1};
"a" = "b";
But we can assign value using comma separator
[a],{a} = {a:1};
Output:
[a] -- [1]
{a} -- {a:1}
Note:
1.Object literal should not be first in the initialization.
2.In string literal never store any value.
() - is qualto return statement
Whatever you given in {}, it will automatically execute itself;
To check just place the code {return;} anywhere in the function it will return the function.
Just look into code snipped for understanding.
var a =5;b=6;
console.log(JSON.stringify({a,b}));
//Output: {"a":5,"b":6}
[a,b],{a,b} = {"a":1, "b":2};
console.log(JSON.stringify([a,b]));
console.log(JSON.stringify({a,b}));
//Output:
//[1,2]
//{"a":1,"b":2}
var name = (function(){return "lotus"});
console.log(name);
//Output: function(){return "lotus"}
name = (function(){return "lotus"})();
console.log(name);
//Output: lotus
name = ({a, b} = {a:3, b:4});
console.log(JSON.stringify(name));
//Output: {"a":3,"b":4}