Way to export a var

Hey,

is there any way to export a var form the main.ts?
I wanna store my highscores in a mongo database.
How can I export var? I tried it with import functions, creating json, use global var.
Nothing works with Makecode.

Can anyone help me in that case?

kind regards

Do export var score = 0. But there could have 1 problem, makecode’s typescript does not want you use var, so instead of use var, please use let, like this.

  export let score = 0