Which option makes the code work as expected?
A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed.
The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
A . Replace line02 with return arr.map(( result, current) => (
B . Replace line 04 with result = result +current;
C . Replace line 03 with if(arr.length == 0 ) (return 0; )
D . Replace line 05 with return result;
Answer: D
Latest JavaScript Developer I Dumps Valid Version with 144 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
                             Subscribe
                            
                        
                                            
                             Login                        
                    
                        0 Comments                    
                                        
                     Inline Feedbacks                    
                    View all comments
                 
	