Answer the question
In order to leave comments, you need to log in
Has anyone seen an article about implementing a setter through a Proxy so that a misspelled setter name is not added to an object as a new property?
Good afternoon!
Somewhere in the summer of 2016, I came across an article in Russian about different ways to implement a setter in js with a solution to the problem of typos when an incorrectly written setter name is added to an object instead of an error; the final way was implementation through Proxy with interception of property names and error output. There is nothing in history, and Google also fails to google it. Anyone remember this article?
For example, if
let user = {
get name () {...},
set name () {...}
}
The call will work fine, but will add a property instead of an error. user.name = 'Вася'
user.namee = 'Петя'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question