Javascript - Do I need to use 'var' when reassigning a variable defined in the function's parameters

Posted by John Himmelman on Stack Overflow See other posts from Stack Overflow or by John Himmelman
Published on 2010-03-22T19:42:56Z Indexed on 2010/03/22 19:51 UTC
Read the original article Hit count: 275

Filed under:
|

I've found many definitions of the 'var' statement but most of them are incomplete (usually from introductory guides/tutorials). Should I use 'var' if the variable & scope has been declared in the params list?

someFunc = function(someVar)
{
   // Is it considered good practice to use 'var', even if it is redundant? 

   var someVar = cheese;
};

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about best-practices