1var str = "JavaScript is the programming language of the Web.";
2
3// this will return string before the word programming
4var result = str.split('programming')[0];
5// result : "JavaScript is the ";
1const string = "0123456789";
2console.log(string.slice(0, 2)); // "01"
3console.log(string.slice(0, 8)); // "01234567"
4console.log(string.slice(3, 7)); // "3456"
1//split string into an array and grab the first item
2
3var streetaddress = addy.split(',')[0];
4