Skip to content
Advertisement

String to array object in javascript

I have a string like this:

JavaScript

I expect to loop until end and read the id and text one by one, how to do this in javascript?

I have tried below:

JavaScript

Advertisement

Answer

Your JavaScript is invalid. Make sure to wrap it in single quotes.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement