Is there a “not in” operator in JavaScript for checking object properties?

It seems wrong to me to set up an if/else statement just to use the else portion…

Just negate your condition, and you’ll get the else logic inside the if:

if (!(id in tutorTimes)) { ... }

Leave a Comment