• It's because it only recognizes basic function declarations (not function expressions). Try:

    function dotwinkle(ths) {
        "compiled";
      // replace 'this' with 'ths'
    }
    
    leds.dotwinkle = function() {
      dotwinkle(this);
    }
    

    You'll also have to pass in 'this' as an argument, as it doesn't handle it properly otherwise.

About

Avatar for Gordon @Gordon started