如何使用列在javascript

代码示例

157
0

javascript阵列

//create an array like so:
var colors = ["red","blue","green"];

//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
4
0

如何宣布一系列在javascript

var array = [item1, item2, .....];
/*

  item1 and item2 could be a string (which is 
  a letter written in double or single quotes like this "string" or 'string') or 
  a number (which is just a normal number on the keypad) or a boolean (which is 
  an experssion which either returns to true of false) and the ..... means that 
  the inputs can be infinite.
  
*/
2
0

如何创建一系列在javascript


let myVar = ["1","2","3"];

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................