I have a string as

string = "firstName:name1, lastName:last1"; 

now I need one object obj such that

obj = {firstName:name1, lastName:last1}

How can I do this in JS?

18 Answers
18

Leave a Reply

Your email address will not be published. Required fields are marked *