has property node js

Solutions on MaxInterview for has property node js by the best coders in the world

showing results for - "has property node js"
Rahma
23 Jul 2016
1const object1 = {};
2object1.property1 = 42;
3
4console.log(object1.hasOwnProperty('property1'));
5// expected output: true
6
7console.log(object1.hasOwnProperty('toString'));
8// expected output: false
9
10console.log(object1.hasOwnProperty('hasOwnProperty'));
11// expected output: false
12