JavaScript/palindrome using console.assert instead