JSFiddle: How to specify that the script is run as a module?

145 Views Asked by At

Some features such as await don't work unless the javascript file is loaded as type="module". However, in JSFiddle, there doesn't seem to be a way to achieve this. Setting the Framework Script Attribute to 'type="module"' does nothing.

Is there any way to make JSFiddle import the main script as a module?

Example not working: https://jsfiddle.net/x9L2eqmo/1/

async function f1(x) {
  return x * 2;
}
x = await f1(5);
console.log(x)
0

There are 0 best solutions below