Ad
  • Custom User Avatar

    Because the objects are already given and you're overwriting them with your code. Just access the objects to get their values. Remove those first two lines from your code, then you'll have to fix something else, but that's unrelated to this.

  • Custom User Avatar

    It's called a spread operator, you can use it to define "the rest" of arguments, like (a, b, ...rest) and that'll be an array of the additional arguments. You can call this as myFunc(a, b, c, d) and the rest argument will contain [c, d]. I hope this makes sense. :)