
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Accessing and returning nested array value - JavaScript?
Let’s say the following is our nested array −
var numbers = [100, 1345, 80, 75, 1000,[35, 55, 67,43,51,78]];
You can take length of first array and can go into the nested array.
Example
The code is as follows fetching nested array value −
var numbers = [100, 1345, 80, 75, 1000,[35, 55, 67,43,51,78]]; var insideInnerValue = numbers[5]; var value = insideInnerValue[5]; console.log(value);
To run the above program, you need to use the following command −
node fileName.js.
Here, my file name is demo264.js.
Output
This will produce the following output on console −
PS C:\Users\Amit\javascript-code> node demo264.js 78
- Related Articles
- Accessing nested JavaScript objects with string key
- Safely Accessing Deeply Nested Values In JavaScript
- JavaScript array.includes inside nested array returning false where as searched name is in array
- Returning the highest value from an array in JavaScript
- Grouping array nested value while comparing 2 objects - JavaScript
- Returning just greater array in JavaScript
- Simplifying nested array JavaScript
- Returning reverse array of integers using JavaScript
- Returning an array with the minimum and maximum elements JavaScript
- MongoDB Increment value inside nested array?
- Grouping nested array in JavaScript
- Returning only odd number from array in JavaScript
- Returning the value of (count of positive / sum of negatives) for an array in JavaScript
- Increment MongoDB value inside a nested array
- Recursion - Sum Nested Array in JavaScript

Advertisements