arcturo / library

A library of free eBooks we're working on

Home Page:http://arcturo.com/library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Critical typo in javascript code (chapter #2)

smashercosmo opened this issue · comments

In the "Aliases & the Existential Operator" section there are two javascript code snippets:

if (typeof brian !== "undefined" && brian !== null) {
  praise;
}

and

var velocity;
velocity = typeof southern !== "undefined" && southern !== null ? southern : 40;

I think that "&&" operator is wrong, and there should be "||" instead.

Oh, sorry, my fault... Somehow I didn't see that there is negation in if-condition.