when are 2 arrays same value in javascript
// the answer when the index is not important
function arrSimilar(arr1, arr2) {
// first lets check if the length is the same
if (arr1.length !== arr2.length) {return false}
let notSimilarItemsCounter = 0
arr1.map((item) => {
!arr2.includes(item) ? notSimilarItemsCounter++ : true ;
})
if ( notSimilarItemsCounter ) {
return false
}else {return true}
}
//byQolam