Answers for "plain javascript check object has attribute"

4

how to check element has an attribute js

let result = element.hasAttribute(name);
Posted by: Guest on July-28-2020
6

js check if object has property

const object1 = new Object();
object1.property1 = 42;

console.log(object1.hasOwnProperty('property1'));
// expected output: true
Posted by: Guest on April-13-2020

Code answers related to "plain javascript check object has attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language