Skip to content

Instantly share code, notes, and snippets.

View barnabyc's full-sized avatar

Barnaby Claydon barnabyc

  • Boston, MA
  • 22:16 (UTC -04:00)
View GitHub Profile
// 1. Write a class to support the following code:
var Person = funcion(name) {
this.name = name;
};
var thomas = new Person('Thomas');
var amy = new Person('Amy');
thomas.name // --> "Thomas"
// 1. Write a class to support the following code:
var Person = funcion(name) {
this.name = name;
};
var thomas = new Person('Thomas');
var amy = new Person('Amy');
thomas.name // --> "Thomas"
(function(){
var index;
function log(){
console.log(index);
}
function iterate(){
log();
// Exercise 2 - Closures
// Wrap the following code in a closure and export only the "countdown" function.
// Code
var foo = (function(){
var index;
function log(){