How to duplicate elements of an array in Node.js?

Awo*_*ism 2 javascript node.js

So I'm trying to duplicate the array elements, for example:

var array = ["chicken","nugget","good"];
Run Code Online (Sandbox Code Playgroud)

into:

var array2 = ["chicken","chicken","nugget","nugget","good","good"];
Run Code Online (Sandbox Code Playgroud)

How to done with this?

dav*_*vid 5

The idiomatic way would be:

["chicken","nugget","good"].flatMap((x) => [x, x]);
Run Code Online (Sandbox Code Playgroud)

Be aware not all javascript environments have flatMap available yet so transpilation may be required.