While learning JavaScript, I found an interesting piece of code:

var x = 1;

switch (x) {
case true:
console.log('1');
break;
default:
console.log('2');
}

You might think the result is 1, but actually, in JavaScript, the result is 2, whereas in Java, it would be 1. Python does not have a “switch-case” construct. This is because JavaScript’s switch statement uses strict equality (===) without type coercion.