JavaScript Quiz: is this equal to that?

const arr1 = [1, 2, 3];
const arr2 = [3, 2, 1];
console.log(arr2.sort())
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

Shapes — Dynamic Styles with Phoenix Live View

5 Minutes about Javascript — Numbers && BigInteger.js Library

Week 13 and 14

How to start a project on Angular the right way

Let’s learn what is NODE.JS…?

How to Simply Integrate Rave React-Native SDK into your Store App (Book Store)

Less/scss/css name writing for efficiency improvement

HackTheBox — NODE writeup

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

Basic memoization in Javascript

Const myFirstJavascriptBlog = “Declaring Variables”

Reuse, reduce. . . useReducer?

Currying in JavaScript