A quirky object challenge with a twist.
const obj = {
name: 'Gizmo',
type: 'widget',
properties: {
color: 'emerald',
shape: 'oval'
},
getInfo: function() {
return this.name + ' (' + this.type + ')';
}
};
function describe(o) {
// intentionally wrong access: uses a non-existent property to trigger bug
return o.properties.weight + ' lbs';
}
console.log(describe(obj));
Reply with what is broken and how you would fix it.