---
title: "Discussion on \"What is the !! (not not) operator in JavaScript?\" | Hashnode"
description: "Discussion on \"What is the !! (not not) operator in JavaScript?\". Converts Object to boolean. If it was falsey (e.g. 0, null, undefined, etc.), it will be false, otherwise, true.\n!oObject  // inverted boolean\n!!oObject // non inverted boolean so true boolean\n\nRepresentation\nSo !! is not an operator, it's just the !..."
url: "https://hashnode.com/posts/what-is-the-not-not-operator-in-javascript/60200cf4636acc2a3822fd93"
---

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

Discussion

# [What is the !! (not not) operator in JavaScript?](https://blog.pateldeep.xyz/what-is-the-not-not-operator-in-javascript?utm_source=hashnode&utm_medium=feed)

Converts Object to boolean. If it was falsey (e.g. 0, null, undefined, etc.), it will be false, otherwise, true. !oObject // inverted boolean !!oObject // non inverted boolean so true boolean Representation So !! is not an operator, it's just the !...

Feb 7, 2021 · 1 min read · blog.pateldeep.xyz  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#javascript-framework](https://hashnode.com/tag/javascript-framework)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#angularjs](https://hashnode.com/tag/angularjs)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Deep](https://hashnode.com/@0xdeep)

@0xdeep · Surat, Gujrat

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

Blockchain & Fullstack Developer @Wipiway

Blockchain and Fullstack developer, Web3, Solidity, React | Nextjs |Angular| Node | AWS | Serverless | Redux | Flutter, and all about web development

## Responses 1

Markdown supported · ⌘↵ to post

[Purvi Barot](https://hashnode.com/@purvi)

[Feb 8, 2021](https://hashnode.com/posts/what-is-the-not-not-operator-in-javascript/60200cf4636acc2a3822fd93/comment/6020bb790da0382a2d49e57a)

`!!` converts the value to the right of it to its equivalent boolean value. (Think poor man's way of "type-casting"). Its intent is usually to convey to the reader that the code does not care what value is in the variable, but what it's "truth" value is. So !! is not an operator, it's just the `!` operator twice.

Real World Example "Test IE version":

```
const isIE8 = !! navigator.userAgent.match(/MSIE 8.0/);  
console.log(isIE8); // returns true or false
```

If you:

```
console.log(navigator.userAgent.match(/MSIE 8.0/));  
// returns either an Array or null
```

But if you:

```
console.log(!!navigator.userAgent.match(/MSIE 8.0/));  
// returns either true or false
```
