Similar but slightly different JavaScript functions I have two very similar functions that exist mainly for syntactic sugar.

deactivate = (el, seek) -&gt; el.find(seek).removeClass("active")
activate = (el, seek) -&gt; el.find(seek).addClass("active")


This allows me to write, for example:

activate $("#something"), ".child"


Using the above purely as an example, ignoring any logical errors with the JavaScript itself… how could this be refactored to be more dry?
You can use js' bracket notation for this task

alter = (el, seek, method) -&gt; el.find(seek)[method + "Class"]("active")
#use like this:
alter $("#something"), ".child", "add"


However, your situation doesn't really call for DRYness. Your method names make more sense than alter, or whichever name you may choose.