Posted On April 4, 2019

Basic JavaScript: Access Multi-Dimensional Arrays With Indexes

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Basic JavaScript: Access Multi-Dimensional Arrays With Indexes
// Setup
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];

// Using bracket notation select an element from myArray such that myData is equal to 8.
var myData = myArray[2][1];

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Replacing Characters Inside Text Files

$textFilesDirectory="C:\Users\$env:computername\Desktop\test" $textFileExtensions='.txt' $regexNewlineOnly="(?<!\r)\n$" $replaceWith="`r`n" function updateFile{ param( $file="C:\Users\$env:username\Desktop\test.txt", $regexMatch="(?<!\r)\n$", $replaceWith="`r`n", $output ) $output=if($output){$output}else{$file} if($file -ne…

CSS: Basic Targeting of Tag, Class, and Type

Cascading Style Sheets (CSS) CSS is often included between the <head><style>CSS-HERE</style></head> sections so that it…

PowerShell: Downloading File Error ‘Internet Explorer engine is not available’

Error Message: PS C:\temp> wget http://download.windowsupdate.com/d/msdownload/update/software/secu/2022/01/windows10.0-kb5009546-x64_d3ab97e9f811d7bf19c268e5e6b5e00e92e110ed.msu wget : The response content cannot be parsed because…