natescode blog
nate's code, blog, projects etc...
‘This’ That and Dispatch
There are numerous blogs and videos about Javascript’s this keyword. In my opinion, virtually all of them fall short and fail to even mention dispatch or binding.
As always, I encourage polyglot programming. So I’ll be showing examples is Javascript, C#, Go and Rust.
Back to the basics First, let us cover some really basic but critical Javascript.
function greet(name) { console.log(`hello, ${name}`); } function greet() { console.log(`hello, stranger`); } greet("natescode"); Which function is called?