You can split up the input as well... fun with strings and arrays
//Lets say you have this string...
var input = "Hello world let me go back to bed"
//Split into an array
var eachWord = input.split(" ") //["Hello", "world", "let".....]
//Get first word
var firstWord = input[0];//"Hello"
//Get rest of sentence
var theRest = input.splice(1, input.length); //["world", "let", "me"...]
//put this into a string
theRest = theRest.join(" ") //"world let me...."
Now you can do whatever you like. Also, it's important to make the string either lowercase or uppercase when you check against it
(firstWord.toLowerCase === "hello")