Things learned today:

  • Word of the day - mulct : to punish by fine.
    • Ex: The ruler used an income tax primarily to mulct his subjects.
  • How to keep a cuff in jeans.
  • Bash command line practice from Coursera - Part 1 and part 2.
  • You don’t know JS - This and Object Prototypes
    • Many programmers don’t fully understand how to use this and fall back to reliance on lexical scope instead.

function foo(num) {
    console.log( "foo: " + num );

    // keep track of how many times `foo` is called
    data.count++;
}

var data = {
    count: 0
};
  • An alternative is to use this.count++; and to call the function via foo.call( foo, i );, which forces this to point at the function object.