About Me:
š Iām currently focusing on backend web development. The server-side is where I thrive, designing and implementing APIs, managing databases.
So first I wanted to say thanks for the detailed reply. I have to head off to work so am leaving a short response but when I get the chance to I will respond with more info. But I did want to quickly respond and say that I was able to figure out the answer. I think pretty much everything I describe below is a general overview of what you have already said but I figured I would also put what I found. Which will hopefully help others out.
Essentially what I figured out was that before get and set keywords were implemented. You used to have to define the get and set methods through the Object.define property method.
Which explains as to why we can call the get and set methods the way we do. Because they are actually just properties.I posted an example below that I got from the mdn docs.
varo={}Object.defineProperty(o,'b',{// Using shorthand method names (ES2015 feature).// This is equivalent to:// get: function() { return bValue; },// set: function(newValue) { bValue = newValue; },get(){returnbValue;},set(newValue){bValue=newValue;},enumerable:true,configurable:true});o.b;// 38
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
So first I wanted to say thanks for the detailed reply. I have to head off to work so am leaving a short response but when I get the chance to I will respond with more info. But I did want to quickly respond and say that I was able to figure out the answer. I think pretty much everything I describe below is a general overview of what you have already said but I figured I would also put what I found. Which will hopefully help others out.
Essentially what I figured out was that before get and set keywords were implemented. You used to have to define the get and set methods through the Object.define property method.
Which explains as to why we can call the get and set methods the way we do. Because they are actually just properties.I posted an example below that I got from the mdn docs.