[js] create proper one-argument closure for Array.push (closes #1997)