I am trying to make an online game and I am using JavaScript on repl.it and I want to save the player's high score when they lose. I have a file called high_scores.txt that is in the same directory as my script.js file, and I want to write the player's score in the file if it is higher than another score. I have been reading and it seems that you can't write files to other computers, but I am trying to write a file on the computer that is hosting the website. Does someone know how to do this?
Example: player's score = 145, files reads [563, 200, 76], this should write the player's score and make it [563, 200, 145] because it was bigger than that one
Or... player's score = 145, files reads [563, 200, 76], this should write the player's score and make it [563, 200, 76, 145]
I just need some way to read and write the file.