Asynchronous JS – JavaScript for C# developers

Below content is an excerpt from my book – “JavaScript for C# developers“.   Consider the below code snippet, which has just 3 statements and seems to be simple but it is worth analysing it to understand how javascript works with respect to execution of asynchronous code.  During the execution phase, JavaScript engine starts executing your code from first statement till last …

How value of ‘this’ is evaluated in JavaScript – Part 2

Below content is an excerpt from my book – “JavaScript for C# developers“.  In the last blog post, we’ve discussed how the value of ‘this’ is evaluated in below scenarios Invocation of function through object Invocation of function directly (without any object) If you’ve not read that blog post, I recommend you to read that blog post before proceeding further. …

How value of ‘this’ is evaluated in JavaScript – Part 1

Below content is an excerpt from my book – “JavaScript for C# developers“.   As with many things in javascript, the evaluation of the value of ‘this’ keyword in JavaScript is completely different from how it is done in C#. Before discussing about how JS engine evaluates the value of ‘this’ keyword in javascript, let us revisit how ‘this’ works in C#. Consider the below C# code snippet, where we …