javascript - What does this variable contain: var message = {}; -


this question has answer here:

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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -