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 -

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

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -