I have a JavaScript module that exported with arrow function with 3 parameters, the following example:
// getMonth.js module
export default (date, type, ...rest) => {
// Represent this return exmaple
return date + ' ' + type + ' ' + rest
}
In the main file, I have an array that I want to Assign the keys of the array as function's parameters
import getMonth from '../modules/month.js'
let splitedParams = ['2016/07/14', 'full']
getMonth({date, type, ...rest} = splitedParams)
But this implementation isn't right and I got some error, How can I do this?
Thanks
getMonth.apply(undefined, splitedParams)