Always using name in a JavaScript?

Why do we always have to use name in a JavaScript?
For example
var name="greg"

if (name=="greg")
alert ("hey greg");


  • edited June 2015

    In java,there is only data type called var which is used to store all the data types like string, integer etc.

    Here name is the name of the variable. Variable name can be any valid name following some rules like there should be the space between words.

    For more Details Refer following link:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion