Skip to content

Instantly share code, notes, and snippets.

View ManojBuilds's full-sized avatar
💭
😜

Manoj Kumar ManojBuilds

💭
😜
View GitHub Profile
@ManojBuilds
ManojBuilds / make-a-person-freeCodeCamp.js
Last active September 4, 2023 04:35
Fill in the object constructor with the following methods below: getFirstName() getLastName() getFullName() setFirstName(first) setLastName(last) setFullName(first, last) Run the tests to see the expected output for each method. These methods must be the only available means of interacting with the object. Each test will declare a new Person ins…
const Person = function(first,last) {
let [firstName,lastName]=[first,last];
this.getFullName = function() {
return `${firstName} ${lastName}`;
};
this.getFirstName = function() {
return `${firstName}`;
};
this.getLastName = function() {