My first attempt produces points often near polar regions:
gps = {
lat: (Math.random() * (90 - -90) + -90) * Math.PI / 180,
lon: (Math.random() * (180 - -180) + -180) * Math.PI / 180,
alt: 0
};
(yes I'm converting to radians) I quickly realized that it's an uneven distribution. According to this site https://dosull.github.io/posts/2021-10-20-random-even-points-on-the-globe/ I'll need to use some sort of "acos" (is that arccos?) function, but I don't even know what language that is. whuber's comment at https://gis.stackexchange.com/questions/236321/generating-random-lat-long-coordinates mentions cosine but I'm not sure exactly what the formula would be.
lat: Math.acos(Math.random() * 2 - 1) - Math.PI / 2,