What would be the output? [New Operator | Explicit Primitive Return]
@Yomesh Gupta
function Person(name) {
this.name = name;
function person() {
return {
name: 'Prithvi'
};
}
var person = {
name: 'Ajay'
};
var person = false;
return person;
}
var yomesh = new Person('Yomesh');
console.log(yomesh);
Option 1
false
Option 2
{"name":"Ajay"}
Option 3
{"name":"Prithvi"}
Option 4
false
Option 5
undefined
Option 6
{"name":"Yomesh"}