Notifications
Clear all

The test passes:

1 Posts
1 Users
0 Likes
135 Views
 Ali
(@ferdigali)
Posts: 698
Noble Member
Topic starter
 

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 number in the array,

The test passes:

Let res = sum2([1, 2, 3 ]) ;

console.assert(res === 6 );

Res = sum3([ 1, 2, 3, 4]);

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. The test passes:

Which two results occur when running the test on the updated sum3 function? Choose 2 answers

  • A . The line 02 assertion passes.
    B. The line 02 assertion fails
    C. The line 05 assertion passes.
    D. The line 05 assertion fails.

Show Answer Hide Answer

Suggested Answer: A,D
 
Posted : 03/12/2022 6:22 pm

Latest Salesforce JavaScript Developer I Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: