Reputation: 3146
Can someone please explain what the following javascript statement is doing?
var default_hide = {"grid": true };
It looks like some sort of conditional statement similar to a ternary statement?
Upvotes: 1
Views: 70
Reputation: 1
It's declaring a object named "default_hide", with one property named "grid" and its corresponding value "true".
After this declaration, you can do: document.write(default_hide.grid);
Upvotes: 0
Reputation: 490597
It's defining an object with a grid
property that is set to true
which is being assigned to default_hide
.
In that context, the braces are defining an Object
.
Upvotes: 1