|
|
@ -2,30 +2,30 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Add new function properties to the object `is` to check a value type |
|
|
|
Add new function properties to the `is` object to check value types. Each function should take one argument, and return a `boolean`. |
|
|
|
|
|
|
|
|
|
|
|
- `is.num` value is a number |
|
|
|
- `is.num`: value is a `number`. |
|
|
|
- `is.nan` value is NaN |
|
|
|
- `is.nan`: value is `NaN`. |
|
|
|
- `is.str` value is a string |
|
|
|
- `is.str`: value is a `string`. |
|
|
|
- `is.bool` value is a boolean |
|
|
|
- `is.bool`: value is a `boolean`. |
|
|
|
- `is.undef` value is undefined |
|
|
|
- `is.undef`: value is `undefined`. |
|
|
|
- `is.def` value is defined |
|
|
|
- `is.def`: value is defined. |
|
|
|
- `is.arr` value is an array |
|
|
|
- `is.arr`: value is an `array`. |
|
|
|
- `is.obj` value is a simple object or null objects |
|
|
|
- `is.obj`: value is a simple object or `null` objects. |
|
|
|
- `is.fun` value is a function |
|
|
|
- `is.fun`: value is a function. |
|
|
|
- `is.truthy` value is truthy |
|
|
|
- `is.truthy`: value is truthy. |
|
|
|
- `is.falsy` value is falsy |
|
|
|
- `is.falsy`: value is falsy. |
|
|
|
|
|
|
|
|
|
|
|
### Notions |
|
|
|
### Notions |
|
|
|
|
|
|
|
|
|
|
|
- [nan-academy.github.io/js-training/examples/primitive-and-operators](https://nan-academy.github.io/js-training/examples/primitive-and-operators.js) |
|
|
|
- [Primitives and operators](https://nan-academy.github.io/js-training/examples/primitive-and-operators.js) |
|
|
|
- [devdocs.io/javascript/operators/typeof](https://devdocs.io/javascript/operators/typeof) |
|
|
|
- [typeof](https://devdocs.io/javascript/operators/typeof) |
|
|
|
- [developer.mozilla.org/en-US/docs/Glossary/Truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) |
|
|
|
- [Truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) |
|
|
|
- [developer.mozilla.org/en-US/docs/Glossary/Falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) |
|
|
|
- [Falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) |
|
|
|
|
|
|
|
|
|
|
|
### Code provided |
|
|
|
### Code provided |
|
|
|
|
|
|
|
|
|
|
|
> all code provided will be added to your solution and doesn't need to be submited. |
|
|
|
> The provided code will be added to your solution, and does not need to be submitted. |
|
|
|
|
|
|
|
|
|
|
|
```js |
|
|
|
```js |
|
|
|
const is = {} |
|
|
|
const is = {} |
|
|
|