---
title: "Discussion on \"How to compare arrays in JavaScript\" | Hashnode"
description: "Discussion on \"How to compare arrays in JavaScript\". array1 === array2 ?\nTo compare arrays in JavaScript, don't assume you can check whether the contents of two JavaScript arrays are the same with === or == (the strict equality or equality operators). You can't.\nconst array1 = [1, 2, 3];\nconst array2 =..."
url: "https://hashnode.com/posts/how-to-compare-arrays-in-javascript/631387b0d49bb9d8c2f741d3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to compare arrays in JavaScript](https://blog.petefowler.dev/how-to-compare-arrays-in-javascript?utm_source=hashnode&utm_medium=feed)

array1 === array2 ? To compare arrays in JavaScript, don't assume you can check whether the contents of two JavaScript arrays are the same with === or == (the strict equality or equality operators). You can't. const array1 = \[1, 2, 3\]; const array2 =...

Sep 3, 2022 · 3 min read · blog.petefowler.dev  
Updated Sep 19, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#arrays](https://hashnode.com/tag/arrays)
-   [#recursion](https://hashnode.com/tag/recursion)

## Written by

[Pete Fowler](https://hashnode.com/@pfowler)

@pfowler · Denver, CO

  
[View profile](https://hashnode.com/@pfowler)

Full Stack Software Engineer | JavaScript, TypeScript, React, C# / .NET, Amazon Web Services (AWS)

Full stack software engineer building a financial data integration SaaS product. Led a complete rebuild of the team’s web app using JavaScript, TypeScript, React, C#/.NET, EntityFramework Core and SQL, with testing in Jest, React Testing Library, xUnit, and Moq. Utilized AWS services including MySQL RDS, EC2, ECS with Docker, S3, Lambda, and EventBridge. Passionate about continuous improvement, clean code, and best practices (where they exist). Dedicated rock climber and runner based in Colorado. Names variables like a first born child.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
