0

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.

1
  • Please include all relevant code here on Stack Overflow, not just links to other sites. Commented Aug 26, 2022 at 11:58

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.