DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
js string slice last n elements
const str = 'ECMAScript 2015'; const n = 4; console.log(str.slice(-n)); // Output: 2015
Source by www.techiedelight.com #
PREVIOUS
NEXT
Tagged:
#js
#string
#slice
#elements
ADD COMMENT
Topic
COMMENT
Name
8+7 =
Submit