Skip to content

Instantly share code, notes, and snippets.

@allenwlee
Created May 1, 2013 01:10
Show Gist options
  • Save allenwlee/5493119 to your computer and use it in GitHub Desktop.
Save allenwlee/5493119 to your computer and use it in GitHub Desktop.
js stuff from lecture
var OrangeTree = function() {
this.age = 0;
this.height = 0;
}
var orangeTree = new OrangeTree();
OrangeTree.prototype.increaseAge = function() {
this
};
OrangeTree.prototype = {
increaseAge: function() {
this.age += 1;
if (this.isDead()) {
this.height += 1;
}
},
isDead: function(){
return this.age > 25;
}
}
callbacks
blocking versus nonblocking code.
$(document).ready(function(){
$.get().done(function(data){console.log('Here 1')});
console.log('Here 2');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment