---
title: "Discussion on \"Why does 1 == True but 2 != True\" | Hashnode"
description: "Discussion on \"Why does 1 == True but 2 != True\". In JavaScript, the double equals (==) operator performs type coercion when comparing two values. Type coercion is the process of converting one type of value to another type in order to compare them.\nWhen comparing a boolean value like true to a non-..."
url: "https://hashnode.com/posts/why-does-1-true-but-2-true/63fd9f502b579f197c55e941"
---

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

Discussion

# [Why does 1 == True but 2 != True](https://iamtoufiq.hashnode.dev/why-does-1-true-but-2-true?utm_source=hashnode&utm_medium=feed)

In JavaScript, the double equals (==) operator performs type coercion when comparing two values. Type coercion is the process of converting one type of value to another type in order to compare them. When comparing a boolean value like true to a non-...

Feb 28, 2023 · 3 min read · iamtoufiq.hashnode.dev  
Read the article

-   [#js](https://hashnode.com/tag/js)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)
-   [#coding](https://hashnode.com/tag/coding)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Toufiq Choudhari](https://hashnode.com/@iamtoufiq2)

@iamtoufiq2 · Thane

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

Front-end Web Developer

Web developer with a passion for creating user-friendly websites. Proficient in HTML, CSS, Js, and React.js and open to new opportunities .

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
