DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

Introduction to Arrays | JavaScript #13

// Chapter 5 { Arrays }
// Arrays are the variables which can hold more than one value

// let marks_class_12 = [ 91, 82, 73, 64 ]
// console.log(marks_class_12)

let marks_class_12 = [ 91, 82, 73, 64, false, "Not Present" ]
console.log(marks_class_12)
marks_class_12[6] = 69 // Adding new value to the Array
marks_class_12[0] = 97 // Change the value to the Array
console.log(marks_class_12[0])
console.log(marks_class_12[1])
console.log(marks_class_12[2])
console.log(marks_class_12[3])
console.log(marks_class_12[4])
console.log(marks_class_12[5])
console.log(marks_class_12[6]) // This is undefined Index 6 does not exist
console.log("The length of marks_class_12 is ",marks_class_12.length)
console.log(marks_class_12)

// In JavaScript , array are object the Typeof Operater on arrays return Object

*PLEASE NOTE I HAD USED REPLIT NODEJS TO WRITE THIS CODE ,YOU CAN CHOOSE WITHEVER IDE YOU COMFORTABLE WITH**

Top comments (0)