【问题标题】:Convert string in array format to array将数组格式的字符串转换为数组
【发布时间】:2016-03-07 11:09:27
【问题描述】:

我有一个结构类似的对象。

{
  details[0][test1]: "text1"
  details[0][test2]: "text2"
  details[0][test3]: "text3"
  details[0][test4]: "text4"
}

我想要的是将属性转换为数组,以便“详细信息” 变成一个关联数组。

【问题讨论】:

  • 欢迎来到 Stack Overflow。我们很乐意为您提供帮助。为了提高您获得答案的机会,以下是一些提示:How do I ask a good question?

标签: javascript jquery arrays object properties


【解决方案1】:

JavaScript 不支持关联数组。而是使用对象,因为 JavaScript 中的数组无论如何都是对象。

http://www.w3schools.com/js/js_arrays.asp

【讨论】:

    猜你喜欢
    • 2017-04-04
    • 2019-06-14
    • 1970-01-01
    • 2012-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-08
    相关资源
    最近更新 更多