Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript string slice

let x = ["a", "b", "c", "d", "e", "f"];

console.log(Array.prototype.slice.call("abcdefg"))
/*[ 'a', 'b', 'c', 'd', 'e', 'f', 'g' ]*/
/*slice can turn a string into an array with its letters as elements*/
Source by www.tutorialstonight.com #
 
PREVIOUS NEXT
Tagged: #javascript #string #slice
ADD COMMENT
Topic
Name
3+6 =