ALL
Some short code snippets which use all JavaScript keywords
In JavaScript, keywords are reserved and cannot be used as variable or function names. For example void, function and this are JavaScript keywords, they are keywords which are reserved for special use. Here is list of the keywords in JavaScript. We also show you some short code snippets which use all the keywords in JavaScript.void function() {//abcd do break;while(typeof delete this); for(var a;;) if (true) with(null) try{}catch(a){}finally{} else throw new 1; switch(1 in 1 instanceof 1) { case false: default: ...
4,436 0 JAVASCRIPT KEYWORD CODE SNIPPET
this in JavaScript
this is a keyword in JavaScript. It refers to an internal object created automatically when a function executes, it can only be used in a function. For example: function test(){    this.x = 1;  }The this keyword will change when a function is called in different situations. However, the general rule is : this refers to the object which calls the function.Next we discuss the use of this in 4 different situations.1. In pure function callThis is the most common use of a function, it is a global call, so the this w...
6,007 0 JAVASCRIPT THIS KEYWORD USE