Parse JSON string into an array

前端 未结 3 1682
别那么骄傲
别那么骄傲 2021-01-03 04:52

I\'m trying to parse a string from JSON and turn those elements into an array in Javascript. Here\'s the code.

      var data = \"{\"fname\":\"Todd\",\"lname         


        
3条回答
  •  有刺的猬
    2021-01-03 05:20

    Something like this. Is that trailing comma intentional?

    var getDayArray = JSON.parse(data).day0.split(",")
    

提交回复
热议问题