Chaz Meyers (cpm) wrote,
Chaz Meyers
cpm

Note to self: precidence matters!

Note to self:

variable = A and B ? some_method_returning_array() : []

`variable` is always set to `A` because `and` does not bind as tightly as `&&`! Oops!

I definitely did not spend an hour not realizing this. Not at all. :)
Tags: computers, nerdcore, ruby, you wish you were as cool as me
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments