title: Passing argument to the function inside the object in Javascript
body: <p>I'm quite sure this question has been asked before, but I couldn't find anything related to my case.</p>
  <p>Here's my function</p>
  <pre><code>function change(prop) {
      document
        .querySelector(&quot;img&quot;)
        .style.setProperty(`--${prop}`, `${this.value}px`);
    }
  
    spacing.onchange = change;
    blur.onchange = change;
  </code></pre>
  <p>I'm struggling with passing argument to <code>change</code> function, because if I do <code>spacing.onchange = change(&quot;prop&quot;)</code> the function will be executed immediately. I want to avoid using <code>addEventListener</code>. So here's the question, how can I pass an argument to my function?</p>