BlogPost_205

James Messina
2 min readMar 1, 2021

Austin Coding Academy

  1. Today I learned about class extensions. This will be important in my web development journey because classes are used all the time in coding. It’s a quicker way to create multiple objects of the same type (class). The class and extends keyword uses templates to make new objects on instances that you create. Extends is beneficial because it inherits properties from the parent constructor which saves time and energy in your coding. Furthermore, it will give your instance all the properties of the parent constructor plus whatever you want to add.
  2. The new arrow function syntax should be used when you are using the keyword ‘this’ to be bound to the context and not the function itself. They also work well with map and reduce methods because it makes the code more readable.

i. The older function can yield within its body and has arguments and keywords while the new function can’t.

ii. The first function foo() {} is used as a declaration and is evaluated upon the entry parameters while the other one is used as an expression and is evaluated in a step-by-step process.

iii. The arrow syntax is best for callbacks which is used with constructors and methods. It is good for methods such as ForEach, reduce, and map.

3. You would use destructuring on an object or array in order to reduce the amount of lines in your code and speed up processing time. An example would be destructuring or unpacking an array and then assigning its values to the new variables you jut created.

4.Closure gives you access to outer functions in the inner function. I would find this useful when coding because I could look back on one section instead of looking over multiple sections.

--

--