JavaScript Quiz: is this equal to that?

const arr1 = [1, 2, 3];
const arr2 = [3, 2, 1];
console.log(arr1 === arr2.sort());
console.log(arr2 === arr2.sort());




Always learning.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating a MERN Application with Deployment to Heroku. ( 2020 Beginner ) Part 2: Front End

Reduce your Dependencies

Parsing raw gossip messages using Node.js

What the heck is this in React ? 🥁🥁(Suspense) 🥁🥁

Hello World! Thank you, COVID.

f is not the same as x => f(x)

Passwordless in 10 minutes — idemeum JavaScript SDK

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saul Feliz

Saul Feliz

Always learning.

More from Medium

What does it mean to have different values in React (JavaScript)?

JS-14 — JavaScript for Programmers, Chapter10

The JavaScript Skills You Need For React

The Enigma of Javascript Proxies