You can learn about JSON and JavaScript from many online sources.
W3Schools is one example that can be good for beginners.
JavaScript Tutorial[
^]
JSON Tutorial[
^]
Please don't ask people to dig into code you found somewhere on the internet and expect them to explain and comment line by line.
If you want to see what happens when the code executes, use the debugger and/or display the value of certain variables using one of the
JavaScript Output[
^] methods.