Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting and not what I would have expected. I just confirmed it in Opera. Also, null<=null is true.

You can use the following javascript link to confirm this:

(Note - I can't ever remember how to embed links properly in YC... is there a reference somewhere?)

javascript:alert('null < 0: '+(null< 0)+'\nnull ==0: '+(null==0)+'\nnull > 0: '+(null>0)+'\nnull<=0:' + (null<=0) + '\nnull < null: '+(null<null)+'\nnull == null: '+(null==null) + '\nnull > null: '+(null>null)+'\nnull<=null: ' + (null<=null));



In Safari 3 and Firefox 1.5, at least, null == null, so I would expect null <= null.

Both Safari 3 and Firefox 1.5 do the decidedly unexpected null <= 0 thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: