DEV Community


Discussion on: Using the "in" Operator in JavaScript

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.

seanwelshbrown profile image
Sean Welsh Brown Author • Edited

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