Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 205 Bytes

is-boolean.md

File metadata and controls

9 lines (7 loc) · 205 Bytes

Is boolean

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

const isBoolean = val => typeof val === 'boolean';
// isBoolean(null) -> false
// isBoolean(false) -> true