The Truth of JavaScript

nFriedly posted an interesting refresher on JavaScript boolean evaluation of non-boolean values : Logical Operators and Truthy / Falsy.

It’s worth mentioning that JavaScript evaluates empty arrays as “true”, whereas PHP evaluates them as “false”.

4 Responses to “The Truth of JavaScript”


  1. Hey, thanks for the mention. That is a good thing to point out. I’m going to make a note of it in the article.

  2. Also worth noting, while were on the subject, php evaluates “0″ as falsy, unlike javascript.

  1. 1 Advanced Javascript: Logical Operators and truthy / falsy - nFriedly Web Dev Tech Blog
  2. 2 World Base Post » Blog Archive » Advanced Javascript: Logical Operators and truthy / falsy

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



1150 feed subscribers
(readers who polled a feed this week)