Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamki/fc5875df7ba57144124b to your computer and use it in GitHub Desktop.
Save adamki/fc5875df7ba57144124b to your computer and use it in GitHub Desktop.

Array Prototype Methods

I understand that functions in JavaScript can take any number of arguments. Yep.

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript. Yep. Anonymous functions are similar to Ruby Blocks.

Where are the methods available to all arrays (e.g. forEach, map, etc.) defined? Array.prototype.methods

I can explain the difference between using a for loop and the forEach method. forEach is faster and easier to write and can be used on JS Objects. for can only be called on Array.

I can explain the difference between forEach and map. Yep. map has the ability to return a modified Array

Can you explain the process of taking a plain JavaScript objects, transforming them into DOM nodes, and appending them to the page.

in Vanilla JS, it would be something like:

  1. create a dom element (var elem = document.createElement) 2.use elem.alt, elem.src etc to define the element
  2. return the element

How comfortable are you using the forEach() method? Yes

How comfortable are you using the map() method? Yes

How comfortable are you using the filter() method? Yes

How comfortable are you using the reduce() method? Yes

How comfortable are you using the sort() method? 7/10. sort() gotcha... sort will sort by first digit by default

How comfortable are you working with simple unit tests in Mocha in the browser? not quite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment