This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
var foo = (function(){ | |
var index; | |
function log(){ |
NewerOlder