I’m working on a JavaScript software that bears resemblance to Windows. It has a desktop, taskbar, etc. and I’m wondering whether I should make the desktop a class or an object?
I’m thinking about making a process list array that holds all instances of objects. It would hold an instance of desktop. Does this make sense? Or should I just have one global class called desktop that I don’t instantiate?
That’s an easy decision, as in JavaScript there are no classes — just objects.
JavaScript is a prototype-based language and not class-based.
You may want to check the following Stack Overflow posts for further reading on the topic: