Skip to content

Instantly share code, notes, and snippets.

View sirjerky's full-sized avatar

Adam Brown sirjerky

  • Greater Seattle Area
View GitHub Profile
@sirjerky
sirjerky / xor.js
Created April 10, 2014 03:15 — forked from hankyates/xor.js
// Using a ternary operator. Implement an exclusive OR function called `preferredName` that has the following interface:
var FirstName,
LastName;
preferredName(FirstName, LastName);
// -> false
FirstName = 'Hank';
// Given the following data structure
// implement a oldestLivingFather method
// that will return the name of the oldest
// living father.
var people = [
{
name: 'Hank',
age: 29,
father: 'Don'
// Implement a decorator function that takes
// a function as an argument and will track
// how many times the passed function was called.
function Add(x, y) {
return x + y;
}
var addCallCount = countDecorator(Add);
@sirjerky
sirjerky / log.txt
Created August 5, 2014 18:25
Grunt and Mocha Test
Running "simplemocha:all" (simplemocha) task
1..1
ok 1 Array indexOf() should return -1 when the value is not present
# tests 1
# pass 1
# fail 0
Done, without errors.