vladpurga/project-lvl1-s272

View on GitHub
src/utils.js

Summary

Maintainability
A
0 mins
Test Coverage
// utils

const getRandomInt = (lower = 0, upper = 1) => {
  const min = Math.min(lower, upper);
  const max = Math.max(lower, upper) + 1;

  return min + Math.floor(Math.random() * Math.floor(max - min));
};

export default getRandomInt;