-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
is-n-divisible-by-x-and-y.js
60 lines (51 loc) · 1.42 KB
/
is-n-divisible-by-x-and-y.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// TODO: rename this file to match slug
function isDivisible(n, x, y) {
const isDivisibleByX = n % x === 0;
const isDivisibleByY = n % y === 0;
return isDivisibleByX && isDivisibleByY;
}
function isDivisible(n, x, y) {
return n % x === 0 && n % y === 0;
}
function isDivisible(n, x, y) {
return n % x == 0 && n % y == 0;
}
function isDivisible(n, x, y) {
const isDivisibleByX = n % x === 0;
const isDivisibleByY = n % y === 0;
if (isDivisibleByX && isDivisibleByY) {
return true;
} else {
return false;
}
}
function isDivisible(n, x, y) {
const isDivisibleByX = n % x === 0;
const isDivisibleByY = n % y === 0;
if (isDivisibleByX && isDivisibleByY) {
return true;
}
return false;
}
function isDivisible(n, x, y) {
const isDivisibleByX = n % x === 0;
const isDivisibleByY = n % y === 0;
if (isDivisibleByX && isDivisibleByY) return true;
return false;
}
function isDivisible(n, x, y) {
const isDivisibleByX = n % x === 0;
const isDivisibleByY = n % y === 0;
if (isDivisibleByX && isDivisibleByY) return true;
else return false;
}
function isDivisible(n, x, y) {
const remainderOfDivisionByX = n % x;
const remainderOfDivisionByY = n % y;
if (!remainderOfDivisionByX && !remainderOfDivisionByY) return true;
return false;
}
console.log(isDivisible(3,3,4), false);
console.log(isDivisible(12,3,4), true);
console.log(isDivisible(8,3,4), false);
console.log(isDivisible(48,3,4), true);