comparing 2 array

//javascript by the davido skills
const arr1 = [1, 2, 3];
const arr2 = [1, 3, 3];

if (arr1.length !== arr2.length) return console.log("false");
let j = 0
for (let i = 0; i < arr1.length; i++) {
        if (arr1[i] === arr2[j]) {
            console.log("yes match", arr1[i], arr2[j]);
        }
        else{
          console.log("no match", arr1[i], arr2[j]);
        }
    j++;
}
//javascript by the davido skills

3.67
3
Awgiedawgie 440220 points

                                    const arr1 = [1, 2, 3];
const arr2 = [1, 3, 3];

if (arr1.length !== arr2.length) return console.log(&quot;false&quot;);
for (let i = 0; i &lt; arr1.length; i++) {
    for (let j = 0; j &lt; arr2.length; j++) {
        if (arr1[i] === arr2[j]) {
            console.log(&quot;yes match&quot;, arr1[i], arr2[j]);
            continue;
        }
        console.log(&quot;no match&quot;, arr1[i], arr2[j]);
    }
}

3.67 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
compare two array value in javascript comparing 4 arrays compare between two arrays compare two arrays in javascript es6 comparing values of single array js comparing array values js compare var with array js compare 2 arrays with javascript javascript equality among arrays javscript comparing two arrays to see what they both have compare values array javascript compare two array in javascript javascript compare items in two arrays javascript compare two arrays by value how to compare values of 2 arrays in javascript why comparing 2 arrays in javascript is false javascript compare 2 arrays compare two array elements how to compare two arrays javascript two array compare how to compare 2 array elements compare array elements javascript how to compare array value with variables compare between two arrays javascript how to compare values of two arrays in js how to compare two arrays in js comparing values within array compare arrays in js compare fields of 2 arrays how to compare contents of two arrays in javascript compare array in javascript two array compare in javascript js compare value array comparing 2 arrays two array comparison in javascript compare two array how to compare two different arrays in javascript how to compare two array in one array compare string with array in javascript js compare 2 array compare value in array js js how to compare two arrays comparing between two arrays compare 2 arrays in js how to compare 3 arrays in javascript compare 2 arrays values javascript how to compare the values of two arrays in javascript how do you compare two arrays compare 2 array in javascript how to compare array values in javascript js compare values in two arrays compare variable value with array comparing 2 arrays in javascript comparing array elements javascript array compare array javascript compare two arrays javascript comparing an 2 items in an array javascript comparing 2 elements in an array best way to compare arrays in javascript how to compare 2 arrays how to compare two arrays javascript es6 compare two arrays compare 2 array javascript compare values in 2 arrays javascript compare 2 array comparing two arrays in javascript fuction comparing two arrays compare two array values how to compare array with array in javascript comparing two arrays javascript compare 2 arrays compare values from two arrays javascript compare with 2 array compare 2 arrays in javascript with array methods compare two arrays how to compare two elements of array in javascript comparing two array in javascript comparing 2 array compare 2 arrays in java script compare two arrays javascript values compare two arrays are equal js compare two arrays js es6 compare two arrays in js compare arrays in javascript how to compare two array in javascript use includes comparing two lists javascript how to compare values in two arrays in javascript javascript compare values in arrays function compare 2 array values javascript javascript compare multiple arrays js compare two arrays how to compare to arrays in javascript comparing two string arrays in javascript comparing two arrays values directly nodejs compare two arrays node compare two arrays nodejs compare equal of two arrays javascript js compare 2 arrays compare elements of two arrays javascript compare two array elements in javascript compare elements in two arrays javascript compare two arrays js compare values of two arrays javascript compare two arrays values in javascript compare two arrays javascripy how to compare array in javascript how to compare two arrays together in js method to compare arrays javascript javascript compare two arrays comparing a number with array javascript javascript one array how to compare two arrays inside javascript how to compare arrays js comapre 2 arrays how to compare data of 2 arrays in javascript compare 2 arrays in javascript compare elements in one array javascript how to compare 2 arrays in js comparing value of 2 arrays in javascript how to compare 2 arrays in javascript compare two array in js how to compare values of two arrays in javascript comparing values inside an array javascript compare two array javascript comparing two arrays in a for loop javascript compare two arrays javascript algorithm javascript compare two arrays equal compare two array values in javascript javascript compare arrays how can we compare arrays in js compare arrays js compare array values javascript js compare arrays javascript compare two arrays and specific value comparing array based on array elements in javascript comparing array elements in javascript compare arrays javascript compare array javascript how to compare two array in JS how to compare arrays with stored array in javascript comparing array javascript compare two elements in array javascript compare values in two arrays javascript how to compare two arrays in javascript compare two arrays in javascript javacript compare two arrays for equality compare two arrays javascript compare 2 arrays js compare two array js compare 2 array js javascript compare arrays for equality compare values of 2 arrays javascript compare 2 arrays javascript comparing two arrays in js how to compare two array in javascript javascript different ways to compare arrays javascript compare Arrays() compare 4 arrays JS comparing two arrays in javascript
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source