Friday, 12 May 2017

Remove last two characters from given string using slice


#Remove last #two #characters from given string using #slice in #javascript. There are some more methods to remove last two characters.

var fruits = ["Orange", "Strawberry", "Banana", "Orange", "Mango"];
var myBest = fruits.slice(-3, -1);



0 comments:

Post a comment