I want to change string to variable, please some one help me.
this is a string >> {"method":"setValue","params":{"cmd_Motor":true}}
I wan to change like this:
I want to change string to variable, please some one help me.
this is a string >> {"method":"setValue","params":{"cmd_Motor":true}}
I wan to change like this:
2
Answers
Use JSON.parse()
I am not sure if I understood your question, but you can convert a string to a JSON object and you can also convert a JSON object to a string:
converting from string to json
converting from json to string