- personally
- when learning
- when coding
- when in a group
- personally
- when learning
- when coding
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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. 3
**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?" | |
Insertion sort is quicker, and uses less resources when the data is nearly sorted. Very slow if the data is reverse ordered. | |
Bubble sort is easy to implement, but very slow, and not stable. | |
Merge sort is very fast and stable, but requires a larger amount of temp space and arrays from recursive calls. |
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?
Looking at the 4 responsibilites makes me think of MVC. Model is 'data/server communication', View is 'presentation and interaction', and Controller is 'setup'. It doesn't suprise me, becuase she breaks the parts of the app into logical parts.
I don't think I mentally did this in ideabox, and my previous projects. I'm sure I broke some things into their own functions, but I didn't look at it from this point of view.
function countdown(number) { | |
if (number !== 0) { | |
console.log(number); | |
countdown(number - 1); | |
} else { | |
console.log(0); | |
} | |
} | |
countdown(5); |
///// index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import HelloWorld from './HelloWorld'; | |
ReactDOM.render(<HelloWorld name='Meeka' />, document.getElementById('container')); | |
///// HelloWorld.js |