-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfizbuz.js
More file actions
34 lines (26 loc) · 1.13 KB
/
fizbuz.js
File metadata and controls
34 lines (26 loc) · 1.13 KB
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
// Create a function that takes a number as an argument and returns
// "Fizz", "Buzz" or "FizzBuzz".
// If the number is a multiple of 3 the output should be "Fizz".
// If the number given is a multiple of 5, the output should be "Buzz".
// If the number given is a multiple of both 3 and 5, the output should be "FizzBuzz".
// If the number is not a multiple of either 3 or 5,
// the number should be output on its own as shown in the examples below.
// function FizzBuzz(num) {
// // If the number given is a multiple of both 3 and 5, the output should be "FizzBuzz".
// if (num % 3 === 0 && num % 5 === 0) return 'FizzBuzz'
// // If the number given is a multiple of 5, the output should be "Buzz".
// else if (num % 5 === 0) return 'Buzz'
// // If the number is a multiple of 3 the output should be "Fizz".
// else if (num % 3 === 0) return 'Fizz'
// else return num.toString()
// }
// console.log(FizzBuzz(3)) //➞ "Fizz"
// console.log(FizzBuzz(5)) //➞ "Buzz"
// console.log(FizzBuzz(10)) //➞ "FizzBuzz"
// console.log(FizzBuzz(4)) //➞ "4"
function bs(params) {
const x = range.params
console.log(x)
return x
}
bs(10)