I get one string by query like '5e6,5e4,123'
.
And I want to make an array containing this query as below in JS.
['5e6', '5e4', '123']
How can I make this? Thank you so much for reading it.
I get one string by query like '5e6,5e4,123'
.
And I want to make an array containing this query as below in JS.
['5e6', '5e4', '123']
How can I make this? Thank you so much for reading it.
You can use .split(',')
var str = "5e6,5e4,123";
var array = str.split(',');
console.log(array);
You can read more on this here
You can make use of split method of string like below:
var res = str.split(',');