Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Data Types

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 120
    Comment on it

    In javascript,There are variables in which we can store the values. We declare a variable with the var keyword:

    var myVariable;
    

    The variables have different data types in javascript.


    VariableExplanationExample
    StringIt takes "A string of text". To verify that the variable is a string, we have to enclose it in quote marks.var myVariable = 'IPhone';
    Number It takes "A number". Numbers never have quotes around them.var myVariable = 50;
    BooleanIt takes "A True/False value". These true and false are special keywords in Javascript and don't need quotes.var myVariable = true/False;
    ArrayA structure that allows you to store multiple values in one single reference.var myVariable = [1,'Bob','Steve',10]; Refer to each member of the array like this: myVariable[0], myVariable[1], etc.
    ObjectBasically, It takes anything. Everything in JavaScript is an object, and can be stored in a variable.Always Keep this in mind as you learn js.var myVariable = document.querySelector('h3'); All of the above examples too.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: