Horje
how to push mutual array elements in an array nested loop javascript Code Example
how to push mutual array elements in an array nested loop javascript
let array1 = ['element1', 'element2', 'element3', 'element4'];
let array2 = ['array2element', 'element2', 'element4'];
let mutualArrayElements = [];

for (let i = 0; i < array1.length; i++) {
  for (let j = 0; j < array2.length; j++) {
    if (array1[i] === array2[j]) {
      mutualArrayElements.push(array1[i]);
    }
  }
};
// for nested loops




Javascript

Related
string to char code array javascript Code Example string to char code array javascript Code Example
js return the highest and lowest number Code Example js return the highest and lowest number Code Example
mongoose nested object without id Code Example mongoose nested object without id Code Example
bigget number in an array java script Code Example bigget number in an array java script Code Example
vue 3 Code Example vue 3 Code Example

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