Header Ads

Header ADS

JavaScript Keyword, Data Type and comment

 


keyword:

.........

keywords are tokens that have special meaning in javascript.



break, case, catch, continue, debugger, default, delete, do, else, 

finally, for, function, if, in, instanceof, new, return, switch, this, throw, try,

typeof,  var, void, while, with.



//keyword  will be always small letter .



Data type:

...............

string.

Number.

Boolean.

objects.


Example  below data type:

string = "hello"

number = 123565

boolean = true/false


Object declure;

...............................

    <p id="demo"></p>

    <script>
    // Create an object:
    var person = {
      firstName: "sumon",
      lastName: "sarker",
      age: 30,
      eyeColor: "brown"
    };
    
    // Display  data from the object:
    document.getElementById("demo").innerHTML =
    person.firstName + " is " + person.age + " years old.";
    </script>


document.write(typeof("hello"));  //Display will be string


document.write(typeof(1234));   //Display will be number


document.write(typeof(true));  //Display will be  boolean


true  = 1

false = 0



Comment: we can use two way for comment our javascript code. 

..................

// document.write(typeof(true));   //Single Line Comment




//Multiline Comment Process Below


           /*document.write("hello world");

document.write("hello world");*/





















No comments

Theme images by fpm. Powered by Blogger.