Not Not in Javascript

Javascript has a peculiar way of converting non booleans to a boolean value.

Came across an expression as

where current_user will be null unless user has logged in.

Mozilla docs mention that ! operation

A null value got converted to false.

Read more on stackoverflow here and here

Read Also:  Custom jQuery UI Form Rails Button Helper

Leave a Reply

Your email address will not be published. Required fields are marked *