Blog 204

David Hebert
Nov 9, 2020

Describe one thing you’re learning in class today.

We’re learning the .find() and .findIndex() methods today. They both are used to get information from an array: .find() gets you the actual element from the array, while .findIndex() gets you the position of the element in the array.

Can you describe the main difference between a forEach loop and a .map() loop and why you would pick one versus the other?

a forEach loop calls a function for every element in an array, while .map() creates a new array to call the function in.

Describe event bubbling.

Event bubbling is what happens when something is changed in a child element with JavaScript. That change will “bubble” up through the parent element(s).

What is the definition of a higher-order function?

A higher order function appears to be a function that takes another function as an argument, and returns a function as its result.

What is an associative array in JavaScript?

Associative arrays are objects that can be redefined as needed. Keys are assigned values and can be adjusted at any time

Why should you never use new Array in JavaScript?

Mostly because it just makes the code look sloppy, and makes it harder to read.

--

--