Valid JS-Dev-101 Dumps shared by EduDump.com for Helping Passing JS-Dev-101 Exam! EduDump.com now offer the newest JS-Dev-101 exam dumps, the EduDump.com JS-Dev-101 exam questions have been updated and answers have been corrected get the newest EduDump.com JS-Dev-101 dumps with Test Engine here:
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array. The test passes: 01 let res = sum3([1, 2, 3]); 02 console.assert(res === 6); 03 04 res = sum3([1, 2, 3, 4]); 05 console.assert(res === 6); A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array. Which two results occur when running the test on the updated sum3 function?
Correct Answer: C,D
New behavior: sum3 now returns the sum of all elements. Line 01: sum3([1, 2, 3]) → 1 + 2 + 3 = 6 Assertion on line 02: res === 6 → passes. Line 04: sum3([1, 2, 3, 4]) → 1 + 2 + 3 + 4 = 10 Assertion on line 05: res === 6 → 10 === 6 is false, so the assertion fails. So: Line 02 assertion passes → D. Line 05 assertion fails → C. ________________________________________