I'm trying to learn about this feature of javascript I keep seeing in code, but I don't know the name of the construction to google for...
var Stats = {
onLoad: function(e) {
// content
this.variable++;
},
variable: 1
};
Is this way of organising functions and variables based on JSON?
It's an "Object Literal" - see the JavaScript Guide.
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