How does the double exclamation (!!) work in javascript?

! is the logical negation or “not” operator. !! is ! twice. It’s a way of casting a “truthy” or “falsy” value to true or false, respectively. Given a boolean, ! will negate the value, i.e. !true yields false and vice versa. Given something other than a boolean, the value will first be converted to a boolean and then negated. For example, !undefined will first convert undefined to false and then negate it, yielding true. Applying … Read more

jQuery $.cookie is not a function

Here are all the possible problems/solutions I have come across: 1. Download the cookie plugin $.cookie is not a standard jQuery function and the plugin needs to be downloaded here. Make sure to include the appropriate <script> tag where necessary (see next). 2. Include jQuery before the cookie plugin When including the cookie script, make sure to include jQuery … Read more