Blog 205

David Hebert
Nov 10, 2020

Describe one thing you’re learning in class today. Why do you think it will be important in your future web development journey?

I’m continuing to learn more about Object Oriented Programming. As far as I can tell, this is a skill that is sought after highly by employers.

Can you offer a use case for the new arrow => function syntax?

One use for arrow functions is when you need to call a function many times, such as adding to a list.

If you had an array of many different values and needed to use .map() on all of them, an arrow function works much better than a traditional function.

Can you give an example for destructuring an object or an array?

Destructuring an object or array makes the code considerably more concise and easy to read.

Accessing an array goes from looking like this:

let first = myArray[0];

let second = myArray[1];

let third = myArray[2];

To this:

let [first, second, third] = myArray;

Explain Closure in your own words. How do you think you can use it? Don’t forget to read more blogs and videos about this subject.

A closure seems to be a way to call a function with multiple times with a different value applied, this way you don’t have to write very similar functions over and over again.

--

--