I want to get an array from strings
const id = 1,8,10
output = ['1','8','10']
Any idea how to do it?
I want to get an array from strings
const id = 1,8,10
output = ['1','8','10']
Any idea how to do it?
If the numbers are separated by ,
u can split the string like this:
const id = '1,8,10'
const output = id.split(',')
console.log(output)
>>> ["1", "8", "10"]