index.js
function getWordToken(str) {
    var word = str.split(/\s/g)[0];
    return {text: word, type: 'WORD', length: word.length};
}
function getWordToken(str) {
    var word = str.split(/\s/g)[0];
    return {text: word, type: 'WORD', length: word.length};
}
function getWordToken ( str ) { var word = str . split ( / \s / g ) [ 0 ] ; return { text : word , type : 'WORD' , length : word . length } ; }
Extract whole word values
Extract whole word values