Job Search Update — JavaScript Objects

gobias101
2 min readFeb 15, 2022

--

This week I had a check-in with my career coach and we too a closer look at my resume. I added a self summary to the top, took out irrelevant bullet points, and changed the order around a bit and hope that it will help with future applications. I also got responses on LinkedIn from a recruiter at Amazon and one from Discord offering me some good advice for breaking into the tech industry as a bootcamp grad.

For the technical portion, lets talk about Object in JavaScript(JS)! In JS objects are a powerful tool to creating the best projects you can. You can create many cool, working JS apps without using objects, but they make the process and code much more streamlined, easier to read, and allow for much simpler scaling.

Objects in JS are wrapped arround curly brackets ({}) and consist of key:value pairs. The values can be any datatype (which we will get into later) like strings, numbers, booleans, etc., even functions and other objects). To declare a simple object you can do this:

const mike = {fullName: "Mike Shah", sex: "male", age: 35, married: true, hobbies:["skating", "music", "scuba"}

To access the data in the object you can first type the object name, then the name of the key whose data you want:

console.log(mike.age)>> 35

We can add a function into the object that gives a greeting:

const mike = {
fullName: "Mike Shah",
sex: "male",
age: 35,
married: true,
hobbies:["skating", "music", "scuba"},
greeting: function() {
return "hello," + this.fullName
}
}

Now, I can run the following and get a greeting:

let hello = mike.greeting;

In the function above, the this refers to the object ‘mike,’ the ‘owner’ of the function.

To create many objects based on the same keys, you can use a constructor function like so:

function Person(fullName, sex, age, married, hobbies) {
this.fullName = fullName;
this.sex = sex;
this.age = age;
this.married = married;
this.hobbies = hobbies;
}

With this constructor, you can create many different profiles as objects for different people:

const violet = new Person("Violet Shah", "female", 5, false, ["princesses", "playing", "eating"]);const kalya = new Person("Kalya Shah", "female", 36, true, ["biking", "hiking", "concerts"]);

Now, we have created two new objects representing two different people based on the same key information!

There are many other ways to create and manipulate objects in JS, to get a more in-depth understanding I suggest you spend some time on the mozilla developer article on JS objects here:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

gobias101
gobias101

No responses yet

Write a response