var something = {
wtf: null,
omg: null
};
My JavaScript knowledge is still horribly patchy since I last programmed with it, but I think I've relearned most of it now. Except for this. I don't recall ever seeing this before. What is it? And where can I learn more about it?
It's object literal syntax. The 'wft' and 'omg' are property names while, null and null are the property values.
It is equivalent to:
var something = new Object();
something.wtf = null;
something.omg = null;
Check out mozilla's documentation on object literals: http://developer.mozilla.org/En/Core_JavaScript_1.5_Guide:Literals#Object_Literals
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With