I have this javascript line in an event handler:
var value = event.currentTarget.value;
which I then use in the switch statement.
switch (value) {
case 9:
return 12;
case 12:
return 9;
}
The problem is that "value" is a string instead of an int.
Should I just apply this to an int?
Or is there a way to get the value as int, for example using jQuery ()?
Or do I just need to use strings in a switch statement?
source
share