JSRange

Developer
Size
3,245 Kb
Views
6,072

How do I make an jsrange?

What is a jsrange? How do you make a jsrange? This script and codes were developed by Steven on 19 December 2022, Monday.

JSRange Previews

JSRange - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>JSRange</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://rawgit.com/facebook/regenerator/master/runtime.js'></script> <script src="js/index.js"></script>
</body>
</html>

JSRange - Script Codes CSS Codes

body { font-size:20px; font-weight: bold;
}
.output { font-weight: normal; font-family: monospace;
}

JSRange - Script Codes JS Codes

"use strict";
(function (originalFunction) { console.log = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } originalFunction.call(this, args); document.body.innerHTML += args === "" ? "<br>" : "Console => <span class='output'>" + args + "</span><br>"; };
})(console.log);
var range = regeneratorRuntime.mark(function range() { var start = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; var stop = arguments[1]; var step = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; var cur, max, i; return regeneratorRuntime.wrap(function range$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: cur = stop === undefined ? 0 : start; max = stop === undefined ? start : stop; i = cur; case 3: if (!(step < 0 ? i > max : i < max)) { _context.next = 9; break; } _context.next = 6; return i; case 6: i += step; _context.next = 3; break; case 9: case "end": return _context.stop(); } } }, range, this);
});
// First attempt
// let range = function*(start = 0, stop, step = 1) {
// let cur = (stop === undefined) ? 0 : start;
// let max = (stop === undefined) ? start : stop;
// if (cur > max) { // Negative direction
// while (cur > max) {
// yield cur;
// cur += step
// }
// } else { // Positive direction
// while (cur < max) {
// yield cur;
// cur += step
// }
// }
// }
console.clear();
console.log("----------BEGIN----------");
for (var _iterator = range(5), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var x = _ref; console.log("range(5) - ", x);
}
for (var _iterator2 = range(1, 5, 1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var x = _ref2; console.log("range(1, 5, 1) - ", x);
}
for (var _iterator3 = range(0, 11, 2), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var x = _ref3; console.log("range(0, 11, 2) - ", x);
}
for (var _iterator4 = range(-4, 6, 3), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var x = _ref4; console.log("range(-4, 6, 3) - ", x);
}
for (var _iterator5 = range(-4, -12, -2), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var x = _ref5; console.log("range(-4, -12, -2) - ", x);
}
JSRange - Script Codes
JSRange - Script Codes
Home Page Home
Developer Steven
Username volv
Uploaded December 19, 2022
Rating 3
Size 3,245 Kb
Views 6,072
Do you need developer help for JSRange?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Steven (volv) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!