jweinst1
11/11/2015 - 9:27 PM

return new phrase based onf irst

return new phrase based onf irst

//return new phrase based on first one, capturing a portion of it.
function talk_phrase(string) {
    var capture = string.match(/how (.+)/);
    capture = capture[1]
    var response = "You can " + capture + " by practicing.";
    return response;
}

console.log(talk_phrase("how do you bounce a tennis ball"));