Start of main content## JavaScript Snippets

The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities.

### Value is nil

JavaScript, Type

Checks if the specified value is

`null`

or`undefined`

.### Value is null

JavaScript, Type

Checks if the specified value is

`null`

.### Number is odd

JavaScript, Math

Checks if the given number is odd.

### Number is power of ten

JavaScript, Math

Checks if the given number is a power of

`10`

.### Number is power of two

JavaScript, Math

Checks if the given number is a power of

`2`

.### Value is undefined

JavaScript, Type

Checks if the specified value is

`undefined`

.### Nth root of number

JavaScript, Math

Calculates the nth root of a given number.

### Radians to degrees

JavaScript, Math

Converts an angle from radians to degrees.

### Value to safe integer

JavaScript, Math

Converts a value to a safe integer.