Typo in FCC JavaScript article

Hi there
in this article

i found typo

function alert() { 
 console.log( this.name + 'is calling'); 
} 

var name = "Kingsley"; 
alert(); // Kingsley

alert must be “Kingsleyis calling”
wrong object defining

var myObj {
  age: 22,
  alert: alert
 }
next code produces error because there is no myobj definition
function alert() { 
 console.log( this.age ); 
} 

var obj = { 
 age: 22 
}; 

var bar = function() { 
 alert.call( myobj ); 
}; 

bar(); // 2 
setTimeout( bar, 100 ); // 22 
// a hard-bound `bar` can no longer have its `this` context overridden 
bar.call( window ); // still 22
1 Like

Hi @sashagra !

Welcome to the forum!

I moved your post to its own topic.

I will email the editorial team at FCC and they will look into it.

Thanks!

1 Like

Hi @sashagra, thanks for bringing this to our attention. I just went in and cleaned up the code snippets, and cleaned up the section on implicit binding.

Please take a look at let me know if you notice any other issues. Also, feel free to let us know if you notice issues in any other articles.

1 Like