jquery - Check if object has a set of properties in javascript - Stack Overflow

PHOTO EMBED

Mon Nov 14 2022 13:17:36 GMT+0000 (Coordinated Universal Time)

Saved by @Floony #javascript

var propertiesToTest = ["prop1", "prop2", "prop3"];
if (propertiesToTest.every(function(x) { return x in a; })) 
    console.log("a has these properties:'prop1, prop2 and prop3'");
content_copyCOPY

https://stackoverflow.com/questions/20578679/check-if-object-has-a-set-of-properties-in-javascript