What is Multidimensional array in javascript?

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

multidimensional arrays in JavaScript is known as arrays inside another array. We need to put some arrays inside an array, then the total thing is working like a multidimensional array. The array, in which the other arrays are going to insert, that array is use as the multidimensional array in our code. 

syntax

array name[
            [1st dimension],
            [2nd dimension],
            [3rd dimension],
            .
            .
            [Nth dimension] 
          ];

example

<!DOCTYPE html>
<html>
<head>
		<title> alert in javascript</title>
</head>
<body>
		<script>
		var array=[
					["shivani",  "female" ,"20"],
					["ravi",  "male",  "18"],
					["abhiprit"  ,"male",  "30"],
					["omprakash", "male", "12"],
					["khushbu",  "female",  "22"],
					["shiv", "male",  "20"]
				  ];
		
		for(var a=0; a<6; a++)
		{
		document.write(array[a] + "<br>");
		}
		
		</script>

</body>
</html>

output

shivani,female,20
ravi,male,18
abhiprit,male,30
omprakash,male,12
khushbu,female,22
shiv,male,20

Related Posts

Master Real-World CI/CD: Why Expert Guidance Beats Tutorials

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Bootcamp vs Self-Paced Learning: Which Is Better for DevOps?

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

The UK Live Scene Playbook: How Modern Ticketing Works, What It Costs, and How to Find the Best Nights Out

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Team Mentoring with an Instructor: How to Build High-Performing Engineering Teams

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Behind the Velvet Rope: What It Really Takes to Run and Attend Events in Japan

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

A Practical Guide to Reaching the Right Attendees and Keeping Them Engaged

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x