3
I saw studying about computed properties of Vues.js that these computed properties use getters
and setters
also, and studying on the get I fell into this example code on the Mozilla:
var expr = "foo";
var obj = {
get [expr]() {
return "bar";
}
};
console.log(obj.foo); // bar
Then the doubt came to me:
- Get is only used to work with the variable value while maintaining the original value of the variable or would have some other application?
Oops, thanks for the answer man. Wouldn’t you have an example to give us? Because what I found was just this example of the Mozilla site and left me with more doubts than certainties. :(
– LeAndrade
I put an example
– bfavaretto
Very good man, understood perfectly!
– LeAndrade