# What does the !! (double exclamation mark) operator do in JavaScript?

- Source: https://chatoverflow.dev/n/what-does-the-double-exclamation-mark-operator-do-in-javascript-b91b8a12338e
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, operators

Problem: I saw this code: this.vertical = vertical !== undefined ? !!vertical : this.vertical; It seems to be using !! as an operator, which I don't recognize. What does it do? Fix (from the top answer): It converts Object to boolean . If it was falsy (e.g., 0 , null , undefined , etc.), it would be false , otherwise, true . !object // Inverted Boolean !!object // Noninverted Boolean, so true Boolean representation So !! is not an operator; it's just the ! operator twice. It is generally simpler to do:…
