Skip to content

Instantly share code, notes, and snippets.

Array Prototype Methods

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

Yes.

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript.

Yes.

JavaScript Functions

I can explain the difference between function declarations and function expressions.

Yes.

I can explain what the value of this is in a normal function.

Yes.

**Step One**: Watch [Sorting Algorithms in JavaScript](https://www.youtube.com/watch?v=uRyqlhjXYQI)
**Step Two**: Fork this gist.
**Step Three**: Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"
All algorithms have different "attributes": stability, runtime analysis, and implementation. A sorting algorithm is chosen based on the necessary combination of these attributes. Some algorithms are fast, but take up a lot of space, which you might not have. Some algorithms are simpler, but don't perform as well.
**Step Four**: _Totally Optional_: take a look at some of the other forks and comment if the spirit moves you.
@toriejw
toriejw / require.markdown
Last active February 9, 2016 20:38 — forked from rrgayhart/require.markdown
The Concept of Require

When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.

Read Node.js, Require and Exports and Organize Your Code with RequireJS

Fork this gist and answer the following questions:

  • In the context of Node, what is a module?
    A module is a "building block" that is made from an individual .js file.

Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)

Step Two: Fork this gist.

Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).

  • Did any of the responsibilities that she lists surprise you?

    None of the responsibilities surprised me, though I wasn't thinking of client side code in this way before.

Step One: Watch Mary Rose Cook Live Codes Space Invaders from Front-Trends. (The second worst conference name ever?)

Step Two: Fork this gist.

Step Three: Respond to this question in your fork: What is one approach you can take from this Mary's code and implement in your project?

How she organized code:

  • Moving logic from the game loop into the game class: having one update method on game, and having that function call slime.update() and ball.update().
  • Puting requestAnimationFrame in a tick method
@toriejw
toriejw / recursion.markdown
Last active February 26, 2016 21:52 — forked from rrgayhart/recursion.markdown
Recursion and Generators Homework
  • Watch Recursion
  • Fork this gist
  • Answer the following questions in your fork
    • Do you pronounce 'babel' in the same way? Nope
      • Follow Up Question: Will you now? Nope
    • What is an example of why/where you might use recursion

An example of where you might use recursion is in a linked list. When you want to find something in a list or find the tail, you would want to do this recursively. A node in a linked list should have no knowledge of the rest of the list, apart from its next node. Looping over a list would be taking the whole list, instead of asking each node if it has what you're looking for. In this example, you would ask the head of the list if it has what you're looking for, and if it doesn't you would call the same function, but on the next node of the head. This would continue until the list returned what you were looking for, or reached the end of the list.

@toriejw
toriejw / readmelove.md
Last active February 26, 2016 22:06 — forked from rrgayhart/readmelove.md
README Love