Your name or email adress:
Do you already have an account?
Forgot your password?
  • Log in or Sign up





    <a href="http://www.instaforex.com/?x=IJGJ">InstaForex</a>


    Advertise here
    Page 1 of 5 123 ... LastLast
    Results 1 to 20 of 86
    1. #1
      Join Date
      Apr 2011
      Posts
      89
      MTV$
      398
      Thanks
      0
      Thanked 1 Time in 1 Post

      JavaScript Variables

      Variables are "containers" for storing information.

      Do You Remember Algebra From School?

      Do you remember algebra from school? x=5, y=6, z=x+y

      Do you remember that a letter (like x) could be used to hold a value (like 5), and that you could use the information above to calculate the value of z to be 11?

      These letters are called variables, and variables can be used to hold values (x=5) or expressions (z=x+y).

      JavaScript Variables

      As with algebra, JavaScript variables are used to hold values or expressions.

      A variable can have a short name, like x, or a more descriptive name, like carname.

      Rules for JavaScript variable names:

      Variable names are case sensitive (y and Y are two different variables)
      Variable names must begin with a letter or the underscore character
      Note: Because JavaScript is case-sensitive, variable names are case-sensitive.

      Example

      A variable's value can change during the execution of a script. You can refer to a variable by its name to display or change its value.

      This example will show you how

      Declaring (Creating) JavaScript Variables

      Creating variables in JavaScript is most often referred to as "declaring" variables.

      You declare JavaScript variables with the var keyword:

      var x;
      var carname;
      After the declaration shown above, the variables are empty (they have no values yet).

      However, you can also assign values to the variables when you declare them:

      var x=5;
      var carname="Volvo";
      After the execution of the statements above, the variable x will hold the value 5, and carname will hold the value Volvo.

      Note: When you assign a text value to a variable, use quotes around the value.

      Note: If you redeclare a JavaScript variable, it will not lose its value.

      Local JavaScript Variables

      A variable declared within a JavaScript function becomes LOCAL and can only be accessed within that function. (the variable has local scope).

      You can have local variables with the same name in different functions, because local variables are only recognized by the function in which they are declared.

      Local variables are destroyed when you exit the function.

      You will learn more about functions in a later chapter of this tutorial.

      Global JavaScript Variables

      Variables declared outside a function becomes GLOBAL, and all scripts and functions on the web page can access it.

      Global variables are destroyed when you close the page.

      If you declare a variable, without using "var", the variable always becomes GLOBAL.

      Assigning Values to Undeclared JavaScript Variables

      If you assign values to variables that have not yet been declared, the variables will automatically be declared as global variables.

      These statements:

      x=5;
      carname="Volvo";
      will declare the variables x and carname as global variables (if they don't already exist).

      JavaScript Arithmetic

      As with algebra, you can do arithmetic operations with JavaScript variables:

      y=x-5;
      z=y+5;

    2. # ADS
      Advertise here Circuit advertisement
      Join Date
      My Birthday
      Posts
      Million and counting


       
    3. #2
      Join Date
      Sep 2012
      Posts
      1,124
      MTV$
      3,336
      Thanks
      1
      Thanked 3 Times in 3 Posts

      Re: JavaScript Variables

      thank you keep it up!!! i got to know many thin from the post. this post is such a wonderful that everybody can learn many things from this. thank you keep it up!!!

    4. #3
      Join Date
      Oct 2012
      Posts
      338
      MTV$
      1,000
      Thanks
      2
      Thanked 1 Time in 1 Post

      Re: JavaScript Variables

      JavaScript variables are "containers" for storing information:

      eg
      var x=5;
      var y=6;
      var z=x+y;

      As with algebra, JavaScript variables can be used to hold values (x=5) or expressions (z=x+y).

      Variable can have short names (like x and y) or more descriptive names (age, sum, totalvolume).

      Variable names must begin with a letter
      Variable names can also begin with $ and _ (but we will not use it)
      Variable names are case sensitive (y and Y are different variables)

    5. #4
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      there are many things such as JavaScript variable scope and so many other things. they are considered to be one of the JavaScript variable scope that is one of the global variables and another one of the local variables. they are used to provide one of the names must begin with a letter.

    6. #5
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one the local variables is considered to be one of the visible only within a function and so many other things. they are used to provide the function parameters and so many other things. they are used to be one of the local to that function and so many other things.

    7. #6
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to provide that the variable names is considered to be one of the case sensitive and so many other things. they are used to know about two different variables is to be considered and so many other things. there are many things such as variable names must begin with a letter and so many other things.

    8. #7
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one of the variable is considered to be one of the value and so many other things. they are used to provide that the variable is considered to be one of the change during the execution of a script and so many other things. they are used to know about that the variable refer by its name to display.

    9. #8
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to provide one of the variables and equations in algebra and so many other things. they are used to know about variables like a, b, c store numbers and so many other things. they are considered to be one of the JavaScript, other programming language and so many other things.

    10. #9
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one of the information such as names to store them and so many other things. they are used to know about the scripting language and so many other things. they are used to be one of the memory such as to stores in computer's memory and so many other things.

    11. #10
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one of the scripting language and so many other things. they are used to provide about the javascript such as strings, numbers, variables, boolean, operators, function, loop, void keyword, dialog boxes, page printing and so many other things. they are used to be five rules for naming variables in JavaScript.

    12. #11
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one of the first character is considered to be one of the letter (a-z, A-Z) or an underscore (_) and so many other things. they are used to provide about the boolean, operators, function, loop, void keyword, dialog boxes, page printing and so many other things.

    13. #12
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      there are many things such as the rest of the name is considered to be one of the made up of letters that is letters a-z , numbers 0-9 or underscore _ and so many other things. they are used to be one of the of JavaScript variable naming to understand in a very easy thing and so many other things.

    14. #13
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are all know that the variable name cannot contains space character and so many other things. they are used to allow that one of the variable is considered to be a short name such as x and so many other things. they are used to provide more descriptive name such as carname and so many other things.

    15. #14
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be one of the case sensitive and so many other things. they are used to provide that the JavaScript variables is considered to be one of the case sensitive and so many other things. they are used to know about the name is different from another one of the names and so many other things.

    16. #15
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to provide one of the "reserve words" such as alert and so many other things. they are used to be one of the variable name as var and so many other things. there are many things such as reserve words in one of the laptop computer and so many other things.

    17. #16
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to be available that the first character must be a letter or an underscore (_) and many other things. they are used to uderstand one of the javaScript variable name and so many other things. they are used to be one of the scripting language and so many other things.

    18. #17
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to provide that the valid variable name is considered to be one of the employee_77 and so many other things. they are used to be one of the scripting language about the javascript and so many other things. they are used to allow that javaScript variables are case sensitive.

    19. #18
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to allow one of the valid variable name such as variable_name, x and so many other things. they are used to know about that JavaScript variables is considered to be one of the using hold values or expressions and so many other things. they are used to know about the scripting language.

    20. #19
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      there are many things such as declaring variables, valid variable name, invalid variable name, naming variables and so many other things. they are used to provide to understand one of the variable and so many other things. they are used to allow one of the var emp_name is considered to be the variable.

    21. #20
      Join Date
      May 2013
      Posts
      674
      MTV$
      2,000
      Thanks
      0
      Thanked 0 Times in 0 Posts

      Re: JavaScript Variables

      they are used to provide that the keyword var is considered to be followed by name of the variable and so many other things. they are used to provide one of the declaration and so many other things. they are used to know about to declare a new variable and so many other things.

    Page 1 of 5 123 ... LastLast

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

    Tags for this Thread

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •