Javascript Object Orientation
I've always preferred PHP/Java over Javascript because of the way in which I can structure code in an object-orientated manner, which allows me to build complex systems that are simple to understand. Whenever I have viewed examples of javascript online, it had always looked like a jumbled mess to me that would take longer to read and understand than to just rewrite from scratch. I couldn't imagine building anything very large that I would be able to maintain a few months after having been developed.
However, taking the time to study a webpage called "OOP inJS" and building the following code sample to play with, I am confident that I can start building something large, yet maintainable in JS. Please play around with the code below for yourself, or use it as a reference as I will be doing. Code that would throw errors are commented out. Uncomment them to see for yourself that they do indeed throw an error.
References
First published: 16th August 2018