Created
April 20, 2020 01:06
-
-
Save showlovezz/29837bc15b9ed134068446aa0bc62471 to your computer and use it in GitHub Desktop.
鼠年全馬鐵人挑戰 - Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = ['MOP', 'CFS', 'WMS', ['AMAT', 'WURTH', 'MGF'], 'TMS'] | |
console.log(data[3][0]) // 會取得 AMAT (會取得第 3 個元素的第 1 個元素) | |
console.log(data[3][2]) // 會取得 MGF (會取得第 3 個元素的第 3 個元素) | |
console.log(data[3][3]) // 會取得 undefined (因為第 3 個元素的第 4 個元素不存在) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment