Open nelsonic opened 8 years ago
This is a reasonably good/useful feature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015 it allows us to do the following:
// imagine that there are already variables in your script/app for name and email var obj = { name, email }
instead of having to type out the values for the fields in the Object:
Object
// imagine that there are already variables in your script/app for name and email var obj = { name: name, email: email }
The JavaScript engine infers what the values are given the names of the keys in the Object...
Given that most browsers don't support this... I will be using it selectively...
This is a reasonably good/useful feature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015 it allows us to do the following:
instead of having to type out the values for the fields in the
Object
:The JavaScript engine infers what the values are given the names of the keys in the
Object
...Given that most browsers don't support this... I will be using it selectively...