showing results for - "object contains property javascript"
Giorgio
15 Apr 2020
1if (x.hasOwnProperty('y')) {}
2
3//or
4
5if ('y' in x) {}
6
7//or
8
9if (x?.y){}
10