Hacker News new | ask | show | jobs
by Noseshine 3477 days ago
Hint: to write code in HN comments indent anything you write by at least two spaces. Result (long lines split - people on mobile may still have to scroll horizontally):

  // The .bind method from Prototype.js
  Function.prototype.bind = function(){
    var fn = this,
        args = Array.prototype.slice.call(arguments),
        object = args.shift();

    return function(){
      return fn.apply(
        object,
        args.concat(Array.prototype.slice.call(arguments))
      );
    };
  }