Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get first word in javascript

let string = "Hello World"

let firstWord = typeof string.split(" ")[0] !== 'undefined' ? string.split(" ")[0] : null; 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #word #javascript
ADD COMMENT
Topic
Name
9+3 =