Answer the question
In order to leave comments, you need to log in
Why is the setter not working?
Here is the implementation of the setter https://jsfiddle.net/L65ny67f/ doesn't run for some reason..
Answer the question
In order to leave comments, you need to log in
Because you get an infinite recursion, when you declare the property "a", inside the SETTER you again set the value, i.e. same setter calling...
https://jsfiddle.net/L65ny67f/1/
Because you don't just need to write "set") In your example, set is just the name of the method, obj.set
set must be written before the name of the method. Example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question