Found this beauty in one of my old projects from school
10 comments
smh, could have used the short form ()=>{ instead of function 😤
I've been coding long enough that I still think of that as a fairly new thing in JS.
In German we say "doppelt hält besser". Is there an English saying like that? "Twice is stronger/more stable/holds better."
I WILL NOT USE ANOTHER LINE. I DON'T NEED IT
The best code has the fewest lines.
This is just as easy to write, just as sloppy but hopefully way easier to read.
js
Game.onload = (data)=>{
let a = data;
a = JSON.decode(a)["GameData"];
a = btoa(a);
a = JSON.decode(a)["GameData"];
return a;
}
Why settle on cammel case ("saveGame") or upper cammel case ("SaveGame") when you can have one of each?
Someone's handed me nested base-64 encoded JSON before and to this day I am moderately annoyed at them.
unity kinda does this ! there is a json file wirh a base-64 encoded string (UTF-16 encoding) and is a completely different data structure with embedded json
smh, could have used the short form ()=>{ instead of function 😤
I've been coding long enough that I still think of that as a fairly new thing in JS.