Javascript string to Array elements?
in javascript function we are getting a string similar to this from a different function almost like that, true, bogus, true, bogus, true, bogus, true, fa wanted to assigin this string to a spectrum like that Array1=true then Array2=false after which you can next Array3=true……etcetc….is there anyway to help convert that string in order to elements while in the array..i highly recommend you kindly assistance me
var str = “true, bogus, true, bogus, true, bogus, true”;
var myArray = str.split(‘, ‘);
// you could the earliest index in a spectrum is 0 not necessarily 1; ).
Leave a Reply
You must be logged in to post a comment.