-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
65 lines (60 loc) · 1.59 KB
/
main.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
61
62
63
64
65
'use strict';
// Do not change any of the function names
// 1
function getBiggest(x, y) {
// x and y are integers. Return the larger integer
// if they are the same return either one
}
// 2
function greeting(language) {
// return a greeting for three different languages:
// language: 'German' -> 'Guten Tag!'
// language: 'Mandarin' -> 'Ni Hao!'
// language: 'Spanish' -> 'Hola!'
// if language is undefined return 'Hello!'
}
// 3
function isTenOrFive(num) {
// return true if num is 10 or 5
// otherwise return false
}
// 4
function isInRange(num) {
// return true if num is less than 50 and greater than 20
// otherwise return false
}
// 5
function isInteger(num) {
// return true if num is an integer
// 0.8 -> false
// 1 -> true
// -10 -> true
// otherwise return false
// hint: you can solve this using Math.floor
}
// 6
function fizzBuzz(num) {
// if num is divisible by 3 return 'fizz'
// if num is divisible by 5 return 'buzz'
// if num is divisible by 3 & 5 return 'fizzbuzz'
// otherwise return num
}
// 7
function isPrime(num) {
// return true if num is prime.
// otherwise return false
// hint: a prime number is only evenly divisible by itself and 1
// hint2: you can solve this using a for loop
// note: 0 and 1 are NOT considered prime numbers
}
// Do not modify code below this line.
// --------------------------------
module.exports = {
getBiggest,
greeting,
isTenOrFive,
isInRange,
isInteger,
fizzBuzz,
isPrime,
};