The other day, I saw this neat JS snippet in a tweet.
var bind = Function.prototype.call.bind(Function.prototype.bind); // #fp
At first glance, I can guess what it does. It turns
y(x,z). With a childlike glee I show it to my colleagues. They ask me what it does. I open my mouth to explain and… nothing comes out. I turn around and walk away.
I decided to work my way through it, with simple examples and lots of comments. This was the result.
I used the Mozilla Developer Network article on bind almost exclusively when figuring this out. I am not sure why it is so low on Google’s rankings, I’ve even taken to adding “mdn” whenever I search for HTML/CSS/JS documentation.
I have realised something about myself. My number one most effective technique for understanding complex ideas is attempting to explain them to someone else. My brain tends to just gloss over the complexitites of a concept, fooling me into thinking I get it. But when you explain something you have to really, really understand it. Through and through.
I learned a lot from that tweet, I felt enlightened after working my way through it. I hope you did too! If you have any comments or ideas, please email me at firstname.lastname@example.org.