Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

I saw some code that seems to use an operator I don't recognize, in the form of two exclamation points, like so: !!. Can someone please tell me what this operator does?

The context in which I saw this was,

this.vertical = vertical !== undefined ? !!vertical : this.vertical;

1 Answer

0 votes
by (106k points)
edited by

You are in misconception “!!” is not an operator, it is just the “!” operator twice. See the example below:-

let isIE8 = false;

isIE8 = !! navigator.userAgent.match(/MSIE 8.0/); console.log(isIE8);

Are you willing to pursue a career in Web Development, here's an opportunity for you Web Developer Certification provided by intellipaat! 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...