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.
-
Please include all relevant code here on Stack Overflow, not just links to other sites.Heretic Monkey– Heretic Monkey2022年08月26日 11:58:19 +00:00Commented Aug 26, 2022 at 11:58
1 Answer 1
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