Javascript split, splice, join methods

Mert Ilis
1 min readJan 16, 2017

split(), splice(), join() javascript methods usage:

The split() method splits a String object into an array of strings by separating the string into substrings.

The splice() method changes the content of an array by removing existing elements and/or adding new elements.

The join() method joins all elements of an array into a string.

Sample:

var a = "asdasd|dasd|rttewrtert";var b = a.split('|');
// ["asdasd", "dasd", "rttewrtert"]
var c = b.splice(1);
// ["dasd", "rttewrtert"]
var d = c.join('');
// dasdrttewrtert

Result; “dasdrttewrtert”

Hope it helps!

Originally published at https://www.weboideas.com on January 16, 2017.

--

--

Mert Ilis

I’m a software development enthusiast who likes trying different web technologies and adding value to his team.