Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.js 344B

123456789101112131415161718192021
  1. 'use strict';
  2. /**
  3. * Create an array of numbers.
  4. * @param {number} from
  5. * @param {number} to
  6. * @returns {number[]}
  7. */
  8. function range(from, to) {
  9. // TODO: make this inlined.
  10. const list = new Array(to - from + 1);
  11. for (let i = 0; i < list.length; i += 1) {
  12. list[i] = from + i;
  13. }
  14. return list;
  15. }
  16. module.exports = {
  17. range,
  18. };