Array and object and datatype in javascript

technical talkiess
0

 Array and object and datatype in javascript:- 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Object array datatype in javascript</title>

</head>

<div class="container">

    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium itaque ad vel?</p>

</div>

<script>

    // primitive datatype

    let a = 45;

    let b = "String";

    let c = true;

    let d = undefined;


    // array and object


    let vishal = {

        name : "Vishal",

        age : 37,

        salary:20000,

        address:"Cidco"

    }

    // accessing the the object element

    // console.log(vishal.salary)

    // console.log(vishal['salary'])


    let array_time = [11,0,1,25,-15,3,"Indeed",undefined];

    // accessing the array element

    // console.log(array_time);

    // accessing the particular elemmnet of array

    // console.log(array_time[0]);

    // sorting the array in the javascript

    // array_time = array_time.sort();

    // push in any value in the array last of the element

    // array_time.push("This is the push value")

    // console.log(array_time);

</script>

<body>

   

</body>

</html>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)