Answers for "what is slice function in javascript?"

-1

slice() javascript

let ourString = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
ourString.slice(0, 11);
console.log(ourString.slice(0, 11));
//Lorem ipsum

string.slice(start, end);
//Start is required. The position where to begin the extraction. 
//First character is at position 0

//End is optional. 
//The position (up to, but not including) where to end the extraction.
Posted by: Guest on February-12-2021

Code answers related to "what is slice function in javascript?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language