Noted November 24, 2021

Typecasting edge cases sure are fun.

console.log( !! '0', !! '0.0', '0' == '0.0' ); // (JS) true, true, false

var_dump( !! '0', !! '0.0', '0' == '0.0' ); // (PHP) false, true, true

I’m not sure there is a right answer here.

By Peter Wilson

Peter has worked on the web for twenty years on everything from table based layouts in the 90s to enterprise grade CMS development. Peter’s a big fan of musical theatre and often encourages his industry colleagues to join him for a show or two in New York or in the West End.

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.