JS Questions for Practice
JS Questions for Practice
b.calculate(30); // 60
c.calculate(40); // 80
console.log(
var hero = {
_name: 'John Doe',
getSecretIdentity: function (){
return this._name;
}
};
console.log(stoleSecretIdentity());
console.log(hero.getSecretIdentity());
9) Output for this
var length = 10;
function fn() {
console.log(this.length);
}
var obj = {
length: 5,
method: function(fn) {
fn();
arguments[0]();
}
};
obj.method(fn, 1);