Can I add content stored in a const to addText() function in officegen-docx?

13 Views Asked by At

In order to create a file in docx, we need to use

const p=docx.createP();
p.addText("Hi");

As I have my data stored in const and I need to know the way to add text from a constant, or any other function.

I tried adding variable name

p.addText(content); //const content

it throws error : ReferenceError: content is not defined.

0

There are 0 best solutions below