I recently found the following code, but I have never seen JS like this before. What does it mean, and does it work?
Var x = this.time = this.time || Data.now();
This code is a short form of,
this.time = this.time || Data.now();
Var x = this.time;
But you have to be careful while using this way of coding in other aspects like,
var a = b = 10;
Because here in the above case b will become a global variable.
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