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
var barker = function(state){ | |
return { bark: function(){ console.log('Woof, I am ' + state.name); } }; | |
}; | |
var driver = function(state){ | |
return { drive: function(){ | |
state.position = state.position + state.speed; | |
console.log(state.position); | |
} }; | |
}; |
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
var runner = function(){ | |
return { | |
run: function(){ | |
console.log(this.name + ' is running away!'); | |
} | |
}; | |
}; | |
var swimmer = function(){ | |
return { |
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
var words = [ | |
"wrt", | |
"wrf", | |
"er", | |
"ett", | |
"rftt" | |
] | |
var alphabet = [] | |
var hash = {}; |
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
// Implement JSON.stringify | |
var example = { | |
"array": [1, 2, 3], | |
"number": 123, | |
"object": { | |
"a": "b", | |
"c": "d", | |
"e": "f" | |
}, | |
"string": "Hello World" |
OlderNewer