I don't know how to test runtime speed but I'm interested in which of these methods would cause more overhead.
Given an object with n properties (also called keys) is it faster to check if that property exists using
Object.keys(obj).includes(prop). Something to consider is what if you need to check multiple properties multiple times?
If you store the
keys in a variable:
const keys = Object.keys(obj) and then make a series of checks
keys.includes(prop1); keys.includes(prop2); is this faster or slower than