Don't judge a book by its cover

Copy and run, individually, the following lines of code in your console:

console.log( '#1:', 'mañana' === 'mañana' );
console.log( '#2:', 'mañana' === 'mañana' );

Why the first execution of console.log logs #1: true?

It logs true because the two words are the same characters.
__match_answer_and_solution__

Why the second execution of console.log logs #2: false?

It logs false because the encoding of characters and the character ñ contains( n and ̃ ) it's an issue with UTF8 encoding.
__match_answer_and_solution__

Last updated

Was this helpful?