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

Strategic Guide to Evaluating and Hiring Expert DevOps Trainers for Corporate 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

The Direct Impact of Tailored Learning Frameworks on Career Acceleration

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

Best Places to Visit in Goa: The Ultimate Goa Travel Guide

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

Best Cosmetic Hospitals in the World: The Ultimate Guide

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

Ultimate India Travel Guide: Best Places to Visit in India

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

Master Your Cloud Journey: Top DevOps Strategies and Tools

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
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x