Reputation: 621
How would I import this external js file by embedding the contents into another file? The entire JavaScript is wrapped around with an anonymous function using arrow syntax, I thought I would be able to do by removing that and assigning it to a variable
var bundle = () => { //contents };
or using export function bundle() {//contents};
and calling it with bundle.htmlReport(data)
, but an error is returned citing it cannot find htmlReport
JavaScript is not my forte.
Upvotes: 0
Views: 130
Reputation: 405
bundle
does not contain a property htmlReport, nor can it contain that property because it's a function and not an object, if the arrow function returns an object with htmlReport
as a property then you can do bundle().htmlReport
Upvotes: 1