promisen.js
function push(array) {
    return pushTask;

    function pushTask(value) {
      Array.prototype.push.call(array, value); // copy
      return resolve(value); // through
    }
  }
function push(array) {
    return pushTask;

    function pushTask(value) {
      Array.prototype.push.call(array, value); // copy
      return resolve(value); // through
    }
  }
function push ( array ) { return pushTask ; function pushTask ( value ) { Array . prototype . push . call ( array , value ) ; // copy return resolve ( value ) ; // through } }
creates a promise-returning function which stores a value into the array.

@class promisen
@static
@function push
@param array {Array|Array-like}
@returns {Function} promise-returning function
@example
var promisen = require("promisen");

var stack = []; // stack is an array

var task2 = promisen(task1, promisen.push(stack));

task2().then(function() {...}); // stack.length == 2
creates a promise - returning function which stores a value into the array .