BlogPost_204

James Messina
2 min readFeb 22, 2021

Austin Coding Academy

  1. Today in class I learned how to use Regex and the methods find() and findIndex(). The find method returns the value of the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, undefined is returned. The findIndex() method returns the index of the first element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test.
  2. You should use the map method if you intend to use the returned array. Map builds a new array so if you don't intend to use it then its best to go with forEach or a simple for loop. ForEach does not store the information into a new variable (no array or anything).
  3. Event bubbling is a type of event propagation where the event first triggers on the innermost target element, and then successively triggers on the ancestors of that element in the same nesting hierarchy until it reaches the outermost DOM element or object. It relates to the order in which event handlers are called when one element is nested inside a second element, and both elements have registered a listener for the same event (such as click).
  4. Higher order functions are functions that operate on other functions, either by taking them as arguments or by returning them. A Higher-Order function is a function that receives a function as an argument or returns the function as output.
  5. An example of a template literals in terms of generating strings is expression interpolation. With template literals you are able to make use of syntactic sugar which make substitutions more readable.
  6. The associative array is basically an object in JS (a set of key value pairs) where indexes are replaced by user defined keys. Associative arrays do not have a length property like a normal array and cannot be traversed using a normal for loop.
  7. New array should never be used in JS because of brevity.
    It has less bytes to transfer over the wire, less bytes to interpret, less mental resources to parse it. Less is more. Furthermore, he Array constructor has completely non-intuitive behavior.

--

--