Require ES2019 in Glitch Environment

Is there a way to force glitch to run on an upgraded version of node to support ES2019 functions such as flatMap() or flat()? I am using a library that uses these functions so there really isn’t another work around currently that I can think of.

Have you tried altering the version of node specified in engines in package.json?

Hey there!

As far as I know, I am sure you can use Babel or TypeScript to use the latest features of JavaScript.
Also, JavaScript allows users to have implementation of their own.

const flatMap = (f, arr) => arr.reduce((x, y) => [...x, ...f(y)], [])

Happy Glitching!

1 Like