Created
April 21, 2016 13:46
-
-
Save eimfach/f0b4887df5e1da1339328d3d46dfaec2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check integer array | |
const num = parseFloat(value); | |
// num is 0 if you parseFloat for example a hex value - we don't | |
// want that | |
if (num === 0 || num % 1 !== 0) { | |
throw new TypeError( | |
`Array value invalid, Integer > 0 expected, got: ${value}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment