What is the arguments object in a JavaScript function?

A JavaScript function has array-like objects called arguments which correspond to the arguments passed to the function. All arguments passed to a JavaScript function can be referred using the arguments object.  Now as we get started, let’s consider the code listed here:In the above function, num1 and num2 are two arguments.  You can refer to … Continue reading What is the arguments object in a JavaScript function?

What is a Default Parameter in a JavaScript function?

A JavaScript function can have default parameters values. Using default function parameters, you can initialize formal parameters with default values. If you do not initialize a parameter with some value, then the default value of the parameter is undefined. While calling function foo, you are not passing any parameter, so the default value of variable … Continue reading What is a Default Parameter in a JavaScript function?

What is the Rest Parameter in a Function?

Learn full article on Infragistics blog A JavaScript function can take any number of parameters. Unlike other languages like C# and Java, you can pass any number of parameters while calling a JavaScript function. JavaScript functions allows unknown number of function parameters. Before ECMAScript 6, JavaScript had arguments variable to access these unknown or variable … Continue reading What is the Rest Parameter in a Function?

What is “let” statement in JavaScript?

Using the let statement, you can create Block scoped local variables in JavaScript. The let statement was introduced in the ECMAScript 6 standard of JavaScript. Before ECMAScript 6, JavaScript had three types of scoping: Global scoping Functional scoping Lexical scoping To explore let statement in detail, consider the code snippet given below: https://gist.github.com/debugmodedotnet/d7bb15f004965cb03ff532e19680195f You will … Continue reading What is “let” statement in JavaScript?

JavaScript Interview Day # 3: what is arguments object in a function

I am very sure that in JavaScript interviews, you must have gone through discussions on functions. It is obvious because functions are very core of JavaScript. Whenever there is a discussion on functions, discussion on arguments object is mandatory. If you do not understand, how arguments works, you do not understand how functions works in … Continue reading JavaScript Interview Day # 3: what is arguments object in a function

JavaScript Interview Day # 2: Can you explain undefined and null

Have they ever asked you? “Can you explain null and undefined in JavaScript?” This question is very trivial but important. As a JavaScript developer, you must have absolute understanding on undefined and null. Let us start by looking at code below: https://gist.github.com/debugmodedotnet/62fc783b3dd79f3feec4b6c87f04d077 Output of above code listing would be “undefined” as shown in the image … Continue reading JavaScript Interview Day # 2: Can you explain undefined and null