githubEdit

Split Method

A relatively easy method to split up strings but I always forget and make it more complicated than needs be.

// syntax
string.split(separator, limit)

// return the second word in the array
let text = "How are you doing today?";
const myArray = text.split(" ");
let word = myArray[1];

Last updated