Using Var Keyword In Javascript

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

Quite a lot of people who use Javascript may wonder sometimes why there is a var keyword. Although we may not notice it since there barely will come a point in time where we may not notice it, there is a real purpose for the var keyword. If you place the var keyword beside a variable name inside a function, it will set that variable’s scope to local. Meaning, once the function finishes its task, that variable will become non-existent.

Bookmark and Share

Found this post useful? Buy me a cup of coffee or help support the sponsors on the right.

Related Posts with Thumbnails

tags:

Leave a Reply