11 things about JavaScript functions that .NET developers should know: Part 2

Read full article on the Infragistics blog

This is the second part of the series in 11 Things about JavaScript Functions that .NET Developers Should Know . In part 1 we discussed the following topics,

  1. JavaScript functions as an expression
  2. JavaScript functions as a statement
  3. Return statements in JavaScript functions
  4. Parameters in JavaScript functions
  5. The Arguments object in JavaScript functions
  6. Varargs JavaScript functions

In this part we will discuss the following topics,

  1. Scopes in functions
  2. Nested functions and Lexical scoping
  3. Functions’s this keyword
  4. Function as constructor
  5. The call() and the apply() methods

Scopes in function

Scoping stands for current context of code execution. Either a variable o expression can be executed in the context of the function they are created or in the global context of the JavaScript. JavaScript does not have the block scoping. It only supports scoping at the function level or global level.

Any variable defined anywhere in the function can be used everywhere in the function but not outside the function.

Read full article on the Infragistics blog

2 responses to “11 things about JavaScript functions that .NET developers should know: Part 2”

  1. […] 11 things about JavaScript functions that .NET developers should know: Part 2 and Step by Step implementing Onion architecture in ASP.NET MVC Application (Dhananjay Kumar) […]

Leave a comment

Create a website or blog at WordPress.com