Why not use \s 
`/\s/.test(page.chatAt(ind)`