Skip to content

Instantly share code, notes, and snippets.

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@polotek
polotek / underscore_deep_extend.js
Created January 1, 2011 20:38
A version of underscore extend method that does deep copy with own properties
_.extend = function(target) {
var i = 1, length = arguments.length, source;
for ( ; i < length; i++ ) {
// Only deal with defined values
if ( (source = arguments[i]) !== undefined ) {
Object.getOwnPropertyNames(source).forEach(function(k){
var d = Object.getOwnPropertyDescriptor(source, k) || {value:source[k]};
if (d.get) {
target.__defineGetter__(k, d.get);
if (d.set) target.__defineSetter__(k, d.set);