Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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.
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
7+7 =