获得JSON值列替代的语法

代码示例

0
0

获得JSON值列替代的语法

var j = {a:"aaaaa", b:"bbbbbb", c:"ccccccc"}
var x = [];
for(key in  j)
{
x.push(j[key]);
}
 
console.log(x); 
/*note that for of does NOT work for this case*/
/*Note we do not need to know the numbers of keys/values ahead of time*/

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

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