Class based OOP in Javascript