Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

split string with last character and return array in javascript

const str = "hello, how are you today?"
const last = str..slice(-1)[0]
console.log({last})
 Run code snippetHide results
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #string #character #return #array #javascript
ADD COMMENT
Topic
Name
1+1 =