rediahmds / tugas-nodejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js Assignment

The assignment is pretty simple, it was to create a simple module which contains our own biodata, such as name, date of birth, place of birth, and our address.

Solution

I came up with the idea of OOP, so I created a class that contains attributes and methods to access each of that attributes. This is the content of utils.js, where I define the PersonBiodata class. Afterwards, all I need to do is import the class and create a new instance that contains my biodata within index.js.

The reason behind the idea I came up with is reusability. I know that this is a simple program, where I need only one instance. But, in case I want to add one or more instances, it will be easier, just create a new instance and done!.

About


Languages

Language:JavaScript 100.0%