2 ms·
so, it is exactly the same as (assume the keys are in a closure i'm too lazy to type it all) function Person(first, last){ var firstNameProperty = {}, // uni
by gcb0 11y ago
so, it is exactly the same as (assume the keys are in a closure i'm too lazy to type it all)
function Person(first, last){
var firstNameProperty = {}, // unique snowflake obj
lastNameProperty = {} // yet another unique obj
this[firstNameProperty] = first;
this[lastNameProperty] = last;
}
ES6 should be saving me from typing all the scoping hacks such as closure. not giving me syntax sugar for things i could do already without odd language constructs (now i have to run TWO loops to get my obj properties. which is what everyone is going to do anyway, since you can iterate on all the symbol properties anyway)