Skip to content

Instantly share code, notes, and snippets.

View bad6e's full-sized avatar
💭
Founder of TrekWeather.com

Bret Doucette bad6e

💭
Founder of TrekWeather.com
View GitHub Profile
@bad6e
bad6e / react-notes.md
Last active December 16, 2015 17:58 — forked from biglovisa/react-notes.md
React in theory

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?

Take her brain... just kidding. I am going to use the game function to instantiate the game board upon window loading. Also passing everything into arrays and her collision method.

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.

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: Respond to this question in your fork: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded). Respond below with your thoughts. Did any of the responsibilities that she lists surprise you? Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?

I'll answer the latter question first - hell no. My CRUD applications take all the data in and so everything on it - in one big method. I like the first step of untagnling your code without writing massive document ready / event handlers to do everything. I also agree that it comes down to design.

**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?"
1. Insertion Sort - great for almost fully sorted arrays - takes up little space - however when the dataset is completely reversed it is slow
2. Bubble Sort has no advantages. Slow and not stable - It checks through every item which makes it slow. Order 2n - worst possible scenario.
3. Merge Sort - fast and stable - however takes up more space - as you need temporary space for arrays and recursive calls.

I can explain the difference between function declarations and function expressions. (3)

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

I can explain what the value of this is when called from the context of an object. (1)

I can explain how to explicitly set the value of this in a function. (1)

I can explain the difference between call and apply. (1.2)

Array Prototype Methods

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

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

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

I can explain the difference between using a for loop and the forEach method. (2)