Conversation

Notices

  1. Finally something I can do with javascript. http://ur1.ca/afmq1

    Friday, 28-Sep-12 17:45:58 UTC from web
    1. @greenenchilada `if ("var age = 18")` just says "does this string I've put in here exist?" -- what you actually want is `if (age < 18)` (var is only used when you first create the variable, and you want to be checking if the age is less than 18, rather than if it's exactly 18)

      Friday, 28-Sep-12 17:55:14 UTC from web
      1. @bitshift I'm not good at JavaScript.

        Friday, 28-Sep-12 17:57:01 UTC from web
      2. @bitshift Oh wait it's just there as a prompt. It's not supposed to have a correct answer.

        Friday, 28-Sep-12 17:58:22 UTC from web
    2. @greenenchilada Also, there's a fundamental difference in between `<something> = <another thing>` and `<something> === <another thing>`. The first is "set <something> to the value of <another thing>", the second is "is <something> equal to <another thing>?"

      Friday, 28-Sep-12 17:58:46 UTC from web
      1. @greenenchilada (There's also a double-equals (==) version, but thanks to historical cruft in javascript, it's better to avoid it entirely.)

        Friday, 28-Sep-12 18:00:25 UTC from web