check if value is boolean javascript