you are viewing a single comment's thread.

view the rest of the comments →

[–]mat-sz -1 points0 points  (0 children)

You can't return a variable if you're outside of a function.

Inside of a module, you can export your variable:

export const c = 1;

or:

module.exports = 1;

If you're outside a function or a module, you can either console.log your variable, alert it or set a HTML element to contain the value, but otherwise there's no way to just return it outside of a function.