v1
3/17/2020 by Seasle 3/17/202000
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const random = (min, max) => (Math.floor(Math.random() * (max - min + 1)) + min);

const pow = (number, power) => {
    if (number === 1 || power === 0) {
        return 1;
    }

    const count = Math.abs(power);
    let result = number;
    for (let index = 0; index < count - 1; index++) {
        result *= number;
    }

    if (power < 0) {
        return 1 / result;
    } else {
        return result;
    }
};

function mynumber(a, b) {
  var c = 1;
  if (b < 0) {
    for (var i = b; i < 0; i++) {
      c /= a;
    }
  } else {
    for (var i = 1; i <= b; i++) {
      c *= a;
    }
  }
  return c;
}
delete caserun single casemove downdrag and drop case


ready



Math.pow(random(1, 10), random(-10, 10));
delete caserun single casemove upmove downdrag and drop case


ready



pow(random(1, 10), random(-10, 10));
delete caserun single casemove updrag and drop case


ready



mynumber(random(1, 10), random(-10, 10));
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