assertValidKeys
Validates all keys in an object match the given keys
.
- Use
Object.keys()
to get the keys of the given object,obj
. - Use
Array.prototype.every()
andArray.prototype.includes()
to validate that each key in the object is specified in thekeys
array.