"Javascript oneliners: functions are attributes too"
Sep 15, 2014
1 minutes
Just a small reminder. Javascript allows you to call methods based on their name. So if a DOM element has a addClass and removeClass which both take the same argument we could write:
<!-- more -->but we could also write
Sometimes this means you can use this technique to write powerful one liners.