Question 1 of 30
In a software development project utilizing Jest as the testing framework, a developer is tasked with writing unit tests for a function that calculates the factorial of a number. The function is defined as follows:
javascript
ction factorial(n) {
(n < 0) return undefined; // Factorial is not defined for negative numbers
(n === 0) return 1; // Base case

Preparing for SalesForce Certified JavaScript Developer I Certified JavaScript Developer I? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free