When my object method is function declaration super keyword work normally.
const user = {
name: "Murad"
};
const murad = {
getName() {
super.name
},
__proto__: user
};
But when I want to change function declaration to function expression JS return Error
const user = {
name: "Murad"
};
const murad = {
getName: function() {
super.name
},
__proto__: user
};
Uncaught SyntaxError: 'super' keyword unexpected here Why this happpened?