You’re able to replicate by so:
var test = {'var1': 'bacon'};
"var1" in test; // Returns true - Correct
!"var1" in test; // Returns false - Correct
"nonexistant" in test; // Returns false - Correct
!"nonexistant" in test; // Returns false - Incorrect - This should be true.. should it not?
The
inoperator binds fairly loosely. It’s generally a good idea to parenthesizeinsubexpressions.Thus,
!"var1" in testis parsed as(!"var1") in testfor example.