split string and push in array code example Example: convert string to array javascript let myArray = str.split(" ");