• support@answerspoint.com

What is the function of the var keyword and when to use it (or omit it)?

Packers and Movers in Patna
1254

What exactly is the function of the var keyword in Javascript, and what is the difference between:

var someNumber = 2;
var someFunction = function() { doSomething; }
var someObject = { }
var someObject.someProperty = 5;

and:

someNumber = 2;
someFunction = function() { doSomething; }
someObject = { }
someObject.someProperty = 5;

When would you use either one, and why/what does it do?

0Answer


Packers and Movers in Patna

Your Answer

    Facebook Share        
       
  • asked 7 years ago
  • viewed 1254 times
  • active 7 years ago

Best Rated Questions