Skip to content

Instantly share code, notes, and snippets.

View Silom's full-sized avatar
🚀
Building a biodegradable rocket

silom Silom

🚀
Building a biodegradable rocket
View GitHub Profile
@Silom
Silom / mergeJson.js
Created February 7, 2014 12:26
This dist shows you how to merge endless json objects in JavaScript.
function merge(json) {
var sources = [].slice.call(arguments, 1);
sources.forEach(function (source) {
for (var property in source) {
json[property] = source[property];
}
});
return json;
}
// merge(json1, json2, json3)
@Silom
Silom / pattern.js
Last active December 17, 2015 16:09
A very easy javascript inheritance pattern. I use it for my node.js projects and I love it
module.exports = function () {
var self = {};
self.run = function () {
console.log("Hello I'm a method");
};
return self;
};
/*