JSFiddle - React, Tailwind, and code Playground
JavaScript
var noCoerce = '2';
switch (noCoerce) {
case 2:
alert('matched the number 2');
case '2':
alert('matched against string 2');
}
var coerceMe = '2'
switch (coerceMe) {
case 2:
alert('matched again the number 2');
case String(2):
alert('matched against coerced string 2');
}