Skip to content
Advertisement

how to store the string “1+2+3” as an array like [“1″,”+”,”2″,”+”,”3″] in javascript?

JavaScript
JavaScript

I am trying to convert the whole string into an array. Then use the splice to edit the numArr Then change the original string, numbers

Advertisement

Answer

You could split the string with nonnumber characters.

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