ds-algo-study
Version:
Just experimenting with publishing a package
22 lines (15 loc) • 592 B
JavaScript
/***********************************************************************
Write a function `diffArrayLen(arr1, arr2)` that takes two arrays. The
function should return true if the arrays have different lengths. The
function should return false otherwise.
Examples:
let a1 = ['a', 'b', 'c'];
let a2 = ['w', 'x', 'y'];
let a3 = [1, 3, 7, 4];
diffArrayLen(a1, a2); // => false
diffArrayLen(a1, a3); // => true
***********************************************************************/
function diffArrayLen(arr1, arr2) {
return arr1.length !== arr2.length;
}
module.exports = diffArrayLen;