Skip to content

Instantly share code, notes, and snippets.

@benschac
Created March 16, 2015 16:10
Show Gist options
  • Save benschac/374132909a60941a69a3 to your computer and use it in GitHub Desktop.
Save benschac/374132909a60941a69a3 to your computer and use it in GitHub Desktop.
// 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