DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

1

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**

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay