Why is 1 == '1\n' true in Javascript?
The same goes for '1\t' (and probably others).
if (1 == '1\n') {
console.log('Equal');
}
else {
console.log('Not Equal');
}
The same goes for '1\t' (and probably others).
if (1 == '1\n') {
console.log('Equal');
}
else {
console.log('Not Equal');
}
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.