Horje
is array equal javascript Code Example
is array equal javascript
// comparing arrays to check for equality - method 1
const a = [1, 2, 3];
const b = [4, 5, 6];
const c = [1, 2, 3];

function arrayEquals(a, b) {
    return Array.isArray(a) &&
        Array.isArray(b) &&
        a.length === b.length &&
        a.every((val, index) => val === b[index]);
}

arrayEquals(a, b);
// false
arrayEquals(a, c);
// true
Source: flexiple.com
check array values equal js
[1,1,1,1].every( (val, i, arr) => val === arr[0] )   // true




Javascript

Related
how to remove duplicate values in array of objects using javascript Code Example how to remove duplicate values in array of objects using javascript Code Example
createslice redux toolkit Code Example createslice redux toolkit Code Example
angular mat select open programmatically Code Example angular mat select open programmatically Code Example
express static auth Code Example express static auth Code Example
how to return 5 records instead of 10 records in datatable Code Example how to return 5 records instead of 10 records in datatable Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9