I'm trying to learn Geolocation API in javascript but the simplest lines of code do not seem to work. If i paste them in the console though, they work normally. Geolocation only works if i paste the code directly into the console, but not if I try to run it from a text editor. I use VS Code and checked all Windows settings and Firefox settings yet nothing seems to fix the problem
const geo = navigator.geolocation;
const position = ()=>{
console.log("OK");
}
geo.getCurrentPosition(position);