Answers for "how to compare the result of two arrays js"

1

how to compare two arrays javascript

function arraysAreIdentical(arr1, arr2){
    if (arr1.length !== arr2.length) return false;
    for (var i = 0, len = arr1.length; i < len; i++){
        if (arr1[i] !== arr2[i]){
            return false;
        }
    }
    return true; 
}
Posted by: Guest on September-07-2020

Code answers related to "how to compare the result of two arrays js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language