v1
- by mindplay 4/12/202100
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
let data = ["A","B","C","D","E"];

delete caserun single casemove downdrag and drop case


ready



function createIndex(children) {
  return new Map(children.map((child,i) => [child,i]));
}

let index = createIndex(data);
delete caserun single casemove upmove downdrag and drop case


ready



function createIndex(children) {
  let map = new Map();
  for (let i=0; i<children.length; i++) {
    map.set(children[i], i);
  }
  return map;
}

let index = createIndex(data);

delete caserun single casemove upmove downdrag and drop case


ready



function createIndex(children) {
  let map = new Map();
  for (let i=children.length; i--;) {
    map.set(children[i], i);
  }
  return map;
}

let index = createIndex(data);
delete caserun single casemove updrag and drop case


ready



function createIndex(children) {
  let i=children.length, map = new Map();
  while (i--) map.set(children[i], i);
  return map;
}

let index = createIndex(data);
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