title: How to return the same variable across multiple functions
body: <p>How can I return <code>__plugin</code> inside <code>add</code> and <code>css</code> function without <code>return __plugin</code> inside them. Can I use a higher order function? Everything is working as expected but I would like to know and maybe refactor this code.</p>
  
  <p><strong>I don't want to write <code>return __plugin</code> every time only one time</strong>.</p>
  
  <pre><code>const $ = (el) =&gt; {
    let _plugin = {};
    const element = document.querySelector.bind(document);
    const css = (style) =&gt; {
      Object.assign(element(el).style, style)
      return _plugin;
    }
    const add = (c) =&gt; {
      element(el).classList.add(c)
      return _plugin;
    }
    _plugin = { add, css }
    return  _plugin
  }
  </code></pre>
  
  <p>Thank you.</p>