Question from the Javascript - Fundamentals test

Write a unit test for the getSize() function in Javascript

Medium

What is the interest of the IF block?

function getSize(tab) { 
    return tab.length; 
} 
const list = ['rice', 'quinoa', 'semolina', 'milk']; 
if (getSize(list)!= 4) { 
    console.error('error');
 } 
Author: KahinaStatus: Published(Update)Question passed 460 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!