SyntaxFix
Write A Post
Hire A Developer
Questions
I 'm using this :
function getFirstWord(str) { let spaceIndex = str.indexOf(' '); return spaceIndex === -1 ? str : str.substr(0, spaceIndex); };