Now that's it for this section.
And this was definitely not a small or easy section.
We had lots of new concepts
and it's very likely that you're not 100% on board
with all those concepts yet.
That's totally normal though.
These are a lot of concepts
and pretty advanced concepts too,
but I wanted to get them out of the way,
because we'll see them throughout the rest of the course.
And therefore, of course, as we start using them there,
also in more realistic examples,
things also will become clearer.
It was important to introduce them now though,
so that later sections can focus on different parts
and you have at least seen those concepts already then.
We did learn about functions
and default parameter values,
hence turning these parameters into optional parameters.
And we learned about the rest parameter operator here,
the three dots that allows us to past in a list of values
instead of a fixed number of values or an array.
We also learned about the spread operator,
which is the opposite,
which allows us to pull out all the values off an array
or object in places where a list of values
or a list of key value pairs is needed
instead of the full array or object.
These were some things we learned about functions.
We also learned about that template literal syntax,
which allows us to construct strings with placeholders.
And hence it gives us a way of constructing longer strings
with dynamic values in a more convenient way
than having to concatenate strings and values
with the plus operator.
Now, we also did dive into some behind the scenes things
thereafter.
We had a look at reference where this primitive values
and that objects are reference values,
and that those values are stored
in a special kind of memory,
which actually leads JavaScript to just store
the address of that space
and memory in constants or variables
instead of the value as a whole.
That's why we can edit such values stored in a constant
without facing an error,
because we're not actually editing
the value in the constant,
but the value stored in memory.
The value in the constant is just the address of that value
and memory, and that address didn't change.
We had a look at a couple of related concepts
and you also learned that you can again use
the spread operator to still create copies of objects
or erase with ease in case you need to fully copy an object
or array,
and you don't want to work with that existing object
or array in memory, for example,
to avoid unwanted mutation of that object or array,
as we had it in this example.
We also explored errors.
Error handling is something which matters.
And with try-catch you can handle errors
in a fine grained way
where you have full control over which code might fail
and how you want to handle that failure.
We also had a closer look at objects again.
We explored classes
which allow us to create our own blueprints
for our own objects,
where we can use the constructor to tell JavaScript
how objects based on that class should be created
and which properties they should have.
And we learned that we can add methods.
Here that this keyword is also important
because this keyword gives us access to the object
that's about to be created,
or that was created in case of methods.
And then we can instantiate classes,
create concrete objects based on the blueprint
by executing the class as a function
and adding the new keyword.
Last but not least, but definitely also very important,
we had a look at async code.
And you've learned that some operations
simply can take a bit longer
and therefore you might want to perform them
in an asynchronous way,
either with help of a callback function
or with help of a promise.
And when working with promises,
you can also turn your overall function
that wraps the async code into an async function,
and then use the await keyword
to go back to more synchronous looking code,
even though it's transformed under the hood,
as you learned.
We also had a look at how error handling could work there,
but also as mentioned before,
we are going to see async code
and promises in action again later in the course,
also once we start working with databases.
And, therefore, we had plenty of new content here,
definitely also check out the written guide and cheat sheet,
which you'll find attached to the last lecture
of this course section.
But definitely also don't feel overwhelmed,
instead we're going to see all these concepts
in action again later in the course.