how to convert text to object in javascript code example
Example: convert string to object javascript
str = "firstName:name1, lastName:last1"; // NB: No enclosing ""
obj = eval('({' + str + '})');
str = "firstName:name1, lastName:last1"; // NB: No enclosing ""
obj = eval('({' + str + '})');