It looks like JavaScript to me. Yes, these games are usually coded in scripting languages like JS or Python, even back in the day they were programmed in custom scripting languages running on the engines of yore. Finally, yes, these kinds of games are a great way to learn programming because they map very well on to basic control flow constructs (if, else, while) and don't usually require additional computer science knowledge.