I have a little issue regarding IN operator in javascript.
As we know that simplifies redundant logical ORs.
I have the following statement:
if(value==="abc" || value==="cde" || value==="efg" || ...){
...
}
I could use
if(value in { "abc":1, "cde":1, "efg":1, ... }){
...
}
I wrote this as an example but Google Chrome Console get an error:
Uncaught SyntaxError: Unexpected token :
Where’s my mistake?
To avoid bugs in case somewhere in your app
Object.prototypehas been modified, you should use: