how to select only first word from an string in js code example Example: get first word of string js let myStr = "Hello World" let firstWord = myStr.split(" ")[0]