In the last exercise you used deepEqual() to compare the values of two objects with loose equality. Arrays are also objects, so deepEqual() also compares their values with loose equality.

const arr1 = [1, 2, 3]; const arr2 = [1, 2, 3]; const arr3 = [1, 2, '3']; assert.deepEqual(arr1, arr2); // No error assert.deepEqual(arr1, arr3); // No error

If you’d like to learn more about deepEqual(), the documentation is available here.



Run the test suite. You should see an error thrown.


Replace assert.equal() with assert.deepEqual().


Run the test suite again.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?