v1
7/7/2022 by zerakot -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const a = 50 ;

const x = [{
    from: 0,
    to: 100,
    color: "red",
  },
  {
    from: 100,
    to: 200,
    color: "blue"
  }
]
delete caserun single casemove downdrag and drop case


ready



let res = x.filter ( (item)=>{  
  if ( ( a >= item.from ) && ( a <= item.to ) ){
    return true;
  } else {
    return false
  }
} );
delete caserun single casemove upmove downdrag and drop case


ready



let res = x.forEach ( (item)=>{  
  if ( ( a >= item.from ) && ( a <= item.to ) ){
    console.log ( 'Element spełnia warunek', item );
  }
} );
delete caserun single casemove upmove downdrag and drop case


ready



const color = x
  .filter(c => c.from <= a && a < c.to)
  .map(c => c.color)[0]
delete caserun single casemove updrag and drop case


ready



const color = x.find(c => c.from <= a && a < c.to).color;
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