Now let's start fresh by removing the existing code.
And today we'll be writing some new code.
One important data structure in JavaScript are objects.
You can create an object by using curly braces and adding key value pairs.
For example, we can have a person object that has a name of Nata, an age of 26.
And if I console log this person,
we're going to get back an object.
Objects allow us to group data together,
including not only variables, but also functions.
For example, we can create a greet function here.
Let's create it using arrow functions that we learned in the previous lesson.
And let's say it console logs:
hi, my name is this name.
Note that this keyword in arrow function
refers to the global scope, not the object itself.
And to have it referred to the object, we would have to use traditional function.
So, let's try greeting this person and the name is going to be undefined.
But because of the difference in this keyword of the arrow functions
and traditional functions, we are going to see different results when
we run this file here. This is the syntax that you'll see throughout this course.
So it's very important that you recognize and know this.
And I'll see you in the next video where
we're going to be discussing more about arrays.
Thanks for watching.