[javascript] How to parse a string in JavaScript?