Start of main content## Recommended snippets

Checks if the first numeric argument is divisible by the second one.

- Use the modulo operator (
`%`

) to check if the remainder is equal to`0`

.

`const isDivisible = (dividend, divisor) => dividend % divisor === 0;`

`isDivisible(6, 3); // true`

Would you like to help us improve 30 seconds of code?Take a quick survey

### Copy sign to number

JavaScript, Math

Returns the absolute value of the first number, but the sign of the second.

### Greatest common divisor

JavaScript, Math

Calculates the greatest common divisor between two or more numbers/arrays.

### Quotient and module of division

JavaScript, Math

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