int checkRange(int orig, int converted) { if (orig.isNaN || converted.isNaN ) { throw 'Expected number'; } if (orig != converted) { throw 'Number is out of range'; } return orig; }