Define the following function: f = function(a){ (function({aa = a}){ console.log('result: ' + aa); })({}); } -------- f(42) expected: result: 42 got: no log at all -------- f(42) f(42) expected: result: 42 result: 42 got: result: 42
Seems to work now.