DEV Community

Discussion on: Using the "in" Operator in JavaScript

Collapse
 
yoursunny profile image
Junxiao Shi

I'd rather avoid plain objects and in operator. They have weird behavior where there's prototype inheritance involved.
Map type and of operator are safer.

Collapse
 
seanwelshbrown profile image
Sean Welsh Brown • Edited

Totally valid point! I usually use Map and Set types in my own work as well.