mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
740 B
740 B
Is
Instructions
Add new function properties to the object `is`` to check a value type
is.num
value is a numberis.nan
value is NaNis.str
value is a stringis.bool
value is a booleanis.undef
value is undefinedis.def
value is definedis.arr
value is an arrayis.obj
value is a simple object or null objectsis.fun
value is a functionis.truthy
value is truthyis.falsy
value is falsy
Notions
- https://nan-academy.github.io/js-training/examples/primitive-and-operators
- https://devdocs.io/javascript/operators/typeof
- https://developer.mozilla.org/en-US/docs/Glossary/Truthy
- https://developer.mozilla.org/en-US/docs/Glossary/Falsy
Code provided
const is = {}