function addObserver(observer, func, { weak = false } = {}) { if (weak) { // ... } } addObserver(observer, 'load', { weak: true });