170
rated 0 times
[
174]
[
4]
/ answers: 1 / hits: 18976
/ 7 Years ago, thu, december 28, 2017, 12:00:00
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.
What am I doing wrong in my code?
const args = {
a: 1
b: 2
}
const fn = (a, b) => a + b
// i am trying with no success
console.log(fn(...args))
More From » spread-syntax