The function of !! in
js is:
!! is generally used to convert the following expressions into Boolean data (boolean)
=== indicates that all types are equal (just write an if to test it yourself) )
!== means you don’t want to wait and include the type (write an if the same way)
|| or means
!! Generally used to convert the following expression into Boolean data (boolean) because javascript It is a weakly typed language (variables do not have a fixed data type), so sometimes it is necessary to force conversion to the corresponding type,
Similar example: a=parseInt("1234") a="1234"+0 //Convert to number b =1234+"" //Convert to string c=someObject.toString() //Convert object to string. Type 1 and Type 4 are explicit conversions, and
2 and 3 are implicit conversions to Boolean type. The conversion, JavaScript convention is similar to c, the rules are: false, undefined, null, 0, "" is false, true, 1, "somestring", [Object] is true