I want to convert this string "F1" into an integer 1.
For example
"F1" ===> 1 "F2" ===> 2 "F3" ===> 3 So far, this is what I've done
parseLevel: function(level) { var levels = { "F1": 1, "F2": 2 }; return levels[level]; } Here's the function
parseLevel: function (level) { return parseInt(level, 10); } I'm getting an error says it's NaN
NaNor0?