Given the following example:
var foo = {
root:
({
key1: "Value1",
key2: "Value2",
key3: "Value3"
})
};
What is the difference compared to the following:
var foo = {
root:
{
key1: "Value1",
key2: "Value2",
key3: "Value3"
}
};
In the first example there is an additional parens wrapping the object. What purpose does this serve? Does it have anything to do with scoping? Does it influence the execution in any way?
Thank you!
There is absolutely no difference here.
AFAIK the one place where it does make a difference is when you evaluate an object literal on the console.