v1
- by jhack_jos 1/27/202100
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const columns = [];
var result;

_.times(100, (i) => columns.push( {i: "pos" + i, "key": "key" + i, width: _.random(100)}));
//uncomment to see dataset in the console
//console.log("This is the dataset:");
//console.log(columns);

function projectES6(...properties)
{
  return function project(object, index, array)
    {
      return _.pick(object, ...properties);
    };
}

function projectBIND(/* properties here */)
{
  var properties = arguments;
  return function project(object, index, array)
    {
      return _.pick.bind(null, object).apply(null, properties);
    };
}

function projectCONCAT(/* properties here */)
{
  var properties = Array.from(arguments);
  return function project(object, index, array)
    {
      return _.pick.apply(null, [].concat(object, properties));
    };
}

function projectUNSHIFT(/* properties here */)
{
  var properties = Array.from(arguments);
  return function project(object, index, array)
    {
      properties.unshift(object);
      return _.pick.apply(null, properties);
    };
}

delete caserun single casemove downdrag and drop case


ready



result = _.map(columns, projectES6("key"));
delete caserun single casemove upmove downdrag and drop case


ready



result = _.map(columns, projectBIND("key"));
delete caserun single casemove upmove downdrag and drop case


ready



result = _.map(columns, projectCONCAT("key"));
delete caserun single casemove updrag and drop case


ready



result = _.map(columns, projectUNSHIFT("key"));
Test Case - click to add another test case
disable teardown JavaScript
teardown JavaScript
//uncomment to see results in the console
//console.log("Result:");
//console.log(result);

Output (DOM) - click to monitor output (DOM) while test is running
RUN