Divides Evenly

Published by hani86400 in

Given two integers, $a and $b, return true if $a can be divided evenly by $b. Return false otherwise.

Examples

dividesEvenly(98, 7) ➞ true
// 98/7 = 14

dividesEvenly(85, 4) ➞ false
// 85/4 = 21.25

Notes

$a will always be greater than or equal to $b.

Watch a quick demo on how Edabit works.