Created
March 16, 2015 16:10
-
-
Save benschac/374132909a60941a69a3 to your computer and use it in GitHub Desktop.
This file contains 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
// Place your code here: | |
// Adds properties of obj2 into obj1 | |
function merge(obj1, obj2) { | |
var mergedObjs = {}; | |
for(var key in obj1) { | |
mergedObjs[key] = obj1[key]; | |
} | |
for(var key in obj2) { | |
mergedObjs[key] = obj2[key]; | |
} | |
return mergedObjs; | |
} | |
var FQL = function(data) { | |
this.data = data; | |
}; | |
FQL.prototype.exec = function() { | |
return this.data | |
} | |
FQL.prototype.count = function() { | |
return this.data.length; | |
// return 36; | |
}; | |
FQL.prototype.limit = function(number) { | |
this.data = this.data.slice(0, number); | |
return this; | |
}; | |
FQL.prototype.where = function(obj) { | |
for(var key in obj) { | |
// if(key === obj.key) { | |
// key; | |
// } | |
console.log(obj.id); | |
} | |
return []; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment