cachaito
12/15/2015 - 11:11 AM

Currying in small things

// lame 
button.setAttribute('disabled', 'disabled');
button.removeAttribute('disabled');

// nice
var disableButton = button.setAttribute.bind(button, 'disabled', 'disabled');
var enableButton = button.removeAttribute.bind(button, 'disabled');