Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 194 Bytes

is-number.md

File metadata and controls

9 lines (7 loc) · 194 Bytes

Is number

Use typeof to check if a value is classified as a number primitive.

const isNumber = val => typeof val === 'number';
// isNumber('1') -> false
// isNumber(1) -> true