js split with max code example

Example 1: javascript explode

//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");

Example 2: javascript split

var arr = ['hey', 'nay', 'wey'];
var let = arr.split(' ');
console.log(let);

Example 3: split() javascript

// It essentially SPLITS the sentence inserted in the required argument
// into an array of words that make up the sentence.

var input = "How are you doing today?";
var result = input.split(" "); // Code piece by ZioTino

// the following code would return as
// string["How", "are", "you", "doing", "todaY"];

Tags:

Php Example