What does {}
indicate in javascript?
For example
var txt={};
{}
means what?
It means an empty object. txt
is declared as a new object in javascript with no properties. If you wanted to add properties you could use this:
var txt = { prop1: 'value 1', prop2: 'value 2' };
and then you can retrieve the values using txt.prop1
and txt.prop2
.
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