I’m writing a method which should concatenate two strings(that are result of json stringify) into one string(which should look like json object with it’s structure).
First one :
{"text":"klk","makeId":"9"}
Second one:
{"firstname":"jjk","lastname":"jkjk","email":"jjkjk@sdasd.com"}
How do I concatenate these two into one json string i.e :
{"text":"klk","makeId":"9", "firstname":"jjk","lastname":"jkjk","email":"jjkjk@sdasd.com"}
I could strip {" and "} then split by comma and achieve this result. I’m wondering is there better more smart way to do this?
These strings are JSON! Parse them, merge them like objects and stringify them again.
JSONshould be available in all recent browsers.