问题:
I have a string as我有一个字符串
string = "firstName:name1, lastName:last1";
now I need one object obj such that现在我需要一个对象 obj 这样
obj = {firstName:name1, lastName:last1}
How can I do this in JS?我怎样才能在 JS 中做到这一点?
解决方案:
参考一: https://stackoom.com/question/4Yce参考二: String to object in JS