Blog 205

Sam Dunegan
2 min readFeb 23, 2021
  1. Describe one thing you’re learning in class today. Why do you think it will be important in your future web development journey? I learned about classes and using constructors within the class and ways to access them. This will be important in my web development future because it will be used in most languages and is a fundamental way to program
  2. Can you offer a use case for the new arrow => function syntax? Its an alternative to a traditional function expression, should not be used as methods and can not be used as constructors.
  3. How does this new syntax differ from the older function signature, function nameFunc(){}, both in style and functionality? The older function can yeild within its body and has arguments and keywords.
  4. Explain the differences on the usage of foo between function foo() {} and const foo = function() {}

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

  1. What advantage is there for using the arrow syntax for a method in a constructor? The arrow syntax is best for callbacks which is used with constructors. It is also good for methods such as ForEach, reduce, and map.
  2. Can you give an example for destructuring an object or an array? You can use destructuring when wanting to skip certain items in an array.
  3. 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. Closure give 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.

--

--