Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get the first word of a string javascript

let sentence = "The big brown fox"
let word = sentence.split(" ")[0]

console.log(word) // The
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #word #string #javascript
ADD COMMENT
Topic
Name
8+8 =