I have a js file with an imported default options and function as below. I am trying to get all the arguments in the function, however it appears that they cannot be used.
import {defaultOptions} from "../defaults.js"
export function getConfig({
width = defaultOptions.width,
height = defaultOptions.height,
fontsize = defaultOptions.fontsize
} = {}) {
// I want to get all the arguments
console.log(arguments);
}
When I call the function with no parameters like getConfig()
and console.log(width)
then it shows the width from the defaultOptions
from the defaults.js
. However the console.log(arguments)
returns Arguments object with length 1 where index 0 : undefined
.
Is there a way I can get all the arguments in such a function?