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");
}

Comments

  • 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:
    http://www.w3schools.com/js/js_variables.asp

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!

Categories

In this Discussion