Why use "!!!"?

following codes:

var a = {};
if(!!!a[tabType]){
   a[tabType] = [];
   a[tabType].push([self,boxObj]);
}else{
   a[tabType].push([self,boxObj]);
}

I think!!! [tabType] equals! a [tabType] why use "!!!" not "!"

Thank you!

+3
source share
3 answers

The design !!forcibly converts to a boolean value. I do not see the point here.

+9
source

There is no point. This is exactly equivalent to use !.

+2
source

. :

if( ! a[tabType]){

, .

-9

Source: https://habr.com/ru/post/1749520/


All Articles