v1
- by jschaf 7/31/202400
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const testLen = () => {
  const rand = Math.random();
  return rand < 1 ? 4192 : rand;
}

const fillArrayWithPush = (len) => {
  const ar = [];
  for (let i = 0; i < len; i++) {
    ar.push({x: i, y: i + 1, z: i + 2, str: `str${i}`});
  }
  return ar;
};

const fillArrayWithLenConstructor = (len) => {
  const ar = new Array(len);
  for (let i = 0; i < len; i++) {
    ar[i] = {x: i, y: i + 1, z: i + 2, str: `str${i}`};
  }
  return ar;
};

const fillArrayWithLiteral = (len) => {
  const ar = [];
  for (let i = 0; i < len; i++) {
    ar[i] = {x: i, y: i + 1, z: i + 2, str: `str${i}`};
  }
  return ar;
};

const fillArrayWithSetLen = (len) => {
  const ar = [];
  ar.length = len;
  for (let i = 0; i < len; i++) {
    ar[i] = {x: i, y: i + 1, z: i + 2, str: `str${i}`};
  }
  return ar;
};

delete caserun single casemove downdrag and drop case


ready



fillArrayWithLenConstructor(testLen());
delete caserun single casemove upmove downdrag and drop case


ready



fillArrayWithLiteral(testLen());
delete caserun single casemove upmove downdrag and drop case


ready



fillArrayWithPush(testLen());
delete caserun single casemove updrag and drop case


ready



fillArrayWithSetLen(testLen());
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN