scrap pad

JavaScript re-introduction

excellent slideshow, A (Re)-Introduction to JavaScript, by Simon Willison. Read through it this morning, but need to read through it again (stats class tomorrow AM?) It was really helpful with thinking about [custom] JavaScript objects, which totally baffle me, thou a little less now [prototype??]. notes:

  • js objects (through slide 77)
  • "short-circuit logic" (cute)

    The && and || operators use short-circuit logic: they will execute their second operand dependant on the first.

    • This is useful for checking for null objects before accessing their attributes:
      var name = o && o.getName();
    • Or for setting default values:
      var name = otherName || "default";
  • extending core objects
  • memory leaks: I should take care to be aware of this esp. because I am writing stuff entirely in firefox.
  • and then the summary of the convoluted stuff, at least. after reading the entire slideshow, this still makes me blink.

linked in this post. there's a link to a pdf of his notes there too.

Archives

who I am