main.js
1
2
3
const object = { };
const prop = 'prop' in object ? object.prop : 'default';
console.log(prop); // => 'default'
Native Browser JavaScript