how to spread an object to a function as arguments? : <p>I have an object an a function which accept arguments, I would like to spread the objects so each property is an argument in that function.</p>

<p>What am I doing wrong in my code?</p>

<pre><code>const args = {
    a: 1
    b: 2
}

const fn = (a, b) =&gt; a + b

// i am trying with no success
console.log(fn(...args))
</code></pre>
