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 585 times
Edit
-2
Community EvaluationsNo one has reviewed this question yet, be the first!