Answers for "javascript slice() function"

0

javascript slice() function

var fruits = new Array ( "apple", "pear", "orange", "banana" );
alert ( fruits.slice ( 1, 3 ) )  // Displays "pear,orange"
alert ( fruits.slice ( 0, -2 ) ) // Displays "apple,pear"
alert ( fruits.slice ( 2 ) )     // Displays "orange,banana"
Posted by: Guest on September-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language