javascript - What does this variable contain: var message = {}; -
this question has answer here:
- what curly braces in javascript mean? 10 answers
does variable hold empty function?
var message = {};
thanks!
does variable hold empty function?
no. doesn't hold empty function.
this empty object. equivalent this
var message = new object();
the syntax using curly braces called object literal. more formally,
an object literal list of 0 or more pairs of property names , associated values of object, enclosed in curly braces ({}).
for detailed explanation of object literals, please have here.
Comments
Post a Comment