This looks like code after being compiled and transpiled from something like Typescript and Babel, it’s not what the engineer actually wrote.
For people that are not programmers: this code probably was generated by a program based on a different, supposedly better code. This is done because many browsers will only execute legacy JavaScript, and that is a pain in the ass to work with, so people work with better different languages or newer versions of JavaScript and a program just translates that to the lagacy JavaScript that old browsers will support.
This looks like code after being compiled and transpiled from something like Typescript and Babel, it’s not what the engineer actually wrote.
For people that are not programmers: this code probably was generated by a program based on a different, supposedly better code. This is done because many browsers will only execute legacy JavaScript, and that is a pain in the ass to work with, so people work with better different languages or newer versions of JavaScript and a program just translates that to the lagacy JavaScript that old browsers will support.