For example I just want to see what the output of this is … but it just evaluates it without giving me what i am trying to display so i can test and modify my code. the console.log is not showing me anything.
I dont want a solution to the question , I just want to know how do I print my test results using console.log
function palindrome(str) {
// Good luck!
var origStr = str;
var strp = str.replace(/[^A-Za-z]/,’’);
console.log(strp);
if(strp.reverse == origStr){
return true ;
}
return false;
}
palindrome(“eye”);
You need to have your browser’s console open to see the result of console.log calls. How you do that depends on the browser. For example, in Chrome it’s: Command+Option+J for Mac or Control+Shift+J for Windows and Linux.
Google “console shortcut” with the name of your browser to find the shortcut for your browser.