JavaScript is an object oriented language and should be treated as such: create class-like functions in different files, rather than long scripts in a single file.