Referencing extra argument passed to function in JavaScript

Viewed 12

I have a function that looks like this:

abc = function (func) {
  let object = {};
  return function() {
    let arg = ???
    if (*something*) {
      object[arg] = func.apply(this, arg);
    }
    else {
      return object[arg];
    }
  }
};

My problem is, how do I refer to arg if arg is an extra argument passed to abc?

Thank you!

0 Answers
Related