@slumbergeist
frontend developer, doodler, procastinator
Full time frontend developer, part time doodler, long time procastinator, tabs over spaces guy, and generally nice human being :)
Nothing here yet.
No blogs yet.
First, let's start with objects. Object is a morty. Every universe have their own version of morty. You have hammerhead morty, lawyer morty, fat morty, evil morty and so on. Now, each of these morties have their own unique trait and personalities. So, an object is nothing but just a container which can have its own defined trait or "property". Also, object can have its own "method" of doing things. So if evil morty is an object then it has its own defined properties like an evil eye patch for an eye, and his own method for dealing with rick. This is how object works in javascript. Now, suppose Rick decided to make a robot morty maker machine. Now the possibilities you can have for the kind of morty reduces drastically from infinite to a fixed set because Rick's machine can only possibly make robot morties of certain type. Each morty must have their eye at proper position, their heads at their designated place, their tails between their legs. So, basically every thing must go to their properly indexed position for the machine to build up a morty. Also, they do not have free will because they are robots and their methods of performing things are defined by Rick. This is what an array is in javascript. It is a special object whose properties are defined as indexes. You can put anything in these indexes and can work with it using the methods it already provides.