[JS] JSON.parse : Convert this string into array of objects

2016. 8. 20. 17:18EXPERIENCE/WEB | HTML5&JS&CSS

반응형

convert this string into array of objects

using the JSON native parser, as it is not only faster than the eval(), it's also more secure.

Native JSON parser is already available in:

Firefox 3.5+ IE 8+ Opera 10.5+ Safari Safari 4.0.3+ Chrome (don't know which version)

 

var myJSONString = '{ "a": 1, "b": 2 }';
myObject = JSON.parse(myJSONString);

 

http://stackoverflow.com/questions/3473639/best-way-to-convert-string-to-array-of-object-in-javascript

 

반응형

'EXPERIENCE > WEB | HTML5&JS&CSS' 카테고리의 다른 글

[JS] Array.Sort() 사용하기  (0) 2019.09.04
Get Start Less  (0) 2014.09.02
.prependTo()  (0) 2014.08.22
make an Interactive Website 5 coding  (0) 2014.08.22
margin by codecademy  (0) 2014.08.21