Variables and Data Type Example In JavaScript (with video tutorial) - HelpMeOutAlways

Saturday, December 7, 2019

Variables and Data Type Example In JavaScript (with video tutorial)

Variables and Data Type Example In JavaScrip


A variable is a container to hold information and Data type is the type of a variable i.e int, char, float, etc.

 Source Code

<!DOCTYPE html>
<html>
  <head>
    <meta charset ="utf-8">
    <title>
      change html content
    </title>
    <style>
      .box{
        background-color: green;
        color: white;
        height: 400px;
        width:400px;
          padding: 100px;
          font-size: 40px
             
      }
   
     
    </style>
  </head>
 
  <body>
    <div class="box" id="bluebox">
      <p>
        <p>HelpMeOutAlways is a place for learning JavaScript<p>
       
      </p>
        <script>
          var x=3;
            window.console.log("The value of x is::"+x);
          var y=5;
           var z= x+y;
            window.console.log("The sum of x+y is:"+z);
            window.console.log(typeof(z));
           
            var firstname="ali";
            var lastname="akber"
            var fullname=firstname+ " "+lastname;
            window.console.log("Your name is:"+fullname);
             window.console.log(typeof(fullname));
            var myArray=[1,2,3];
            window.console.log(myArray);
                        window.console.log(typeof(myArray));

        </script>
     
    </div>
    </body>
</html>






Output


javaScript by helpmeoutalways

Video Tutorial

No comments:

@way2themes