ExamGecko
Ask Question

Salesforce Certified JavaScript Developer I Practice Test 3

00:00:00
Show Answer
Report Issue   Restart test

Question 1 / 40

A developer wrote a fizzbuzz function that when passed in a number, returns the following:

• 'Fizz' if the number is divisible by 3.

• 'Buzz' if the number is divisible by 5.

• 'Fizzbuzz' if the number is divisible by both 3 and 5.

• Empty string if the number is divisible by neither 3 or 5.

Which two test cases will properly test scenarios for the fizzbuzz function?

Choose 2 answers

let res = fizzbuzz(5); console.assert ( res === ' ' );
let res = fizzbuzz(5); console.assert ( res === ' ' );
let res = fizzbuzz(15); console.assert ( res === ' fizzbuzz ' )
let res = fizzbuzz(15); console.assert ( res === ' fizzbuzz ' )
let res = fizzbuzz(Infinity); console.assert ( res === ' ' )
let res = fizzbuzz(Infinity); console.assert ( res === ' ' )
let res = fizzbuzz(3); console.assert ( res === ' buzz ' )
let res = fizzbuzz(3); console.assert ( res === ' buzz ' )
Comment (0)
Suggested answer: B, C, D
asked 23/09/2024
Scott Wells
46 questions