Start of main content
# JavaScript Math 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.

### Quotient and module of division

Returns an array consisting of the quotient and remainder of the given numbers.

JavaScript, Math · Oct 7, 2020

### How can I check if a number is even or odd using JavaScript?

Check if a number is even or odd using JavaScript using the modulo operator or bitwise AND operator.

JavaScript, Math · Oct 6, 2023

### What is the difference between prefix and postfix operators?

While both the prefix and postfix operators increment a value, the resulting value of the expression is very different.

JavaScript, Math · Oct 31, 2021

### Number to decimal mark

Converts a number to a decimal mark formatted string.

JavaScript, Math · Oct 22, 2020

### Distance between two points

Calculates the distance between two points.

JavaScript, Math · Dec 28, 2020