what does double exclamation mark mean in javascript code example
Example 1: double exclamation mark js
!!false === false
!!true === true
!!0 === false
!!1 === true
!!parseInt("foo") === false
!!-1 === true
!!(1/0) === true
!!"" === false
!!"foo" === true
!!"false" === true
!!window.foo === false
!!null === false
!!{} === true
!![] === true
Example 2: javascript operator double not
!!0
!!""
!!null
!!undefined
!!NaN
Example 3: javascript double exclamation mark
const isIE8 = !! navigator.userAgent.match(/MSIE 8.0/);
console.log(isIE8);
Example 4: javascript double exclamation mark
console.log(navigator.userAgent.match(/MSIE 8.0/));
Example 5: javascript double exclamation mark
console.log(!!navigator.userAgent.match(/MSIE 8.0/));
Example 6: javascript double exclamation mark
!oObject
!!oObject