Prototype: implement secondsFromMinutes(minutes). Accept a nonnegative safe-integer Number and return minutes × 60 as a safe-integer Number. Throw RangeError for every other value or an overflowing result.

Final: implement parseCount(text) and addExact(left, right). parseCount accepts a string, trims it, and accepts only one or more ASCII digits whose numeric value is a nonnegative safe integer. Return null for invalid text/range; throw TypeError for a non-string input. Leading zeros are permitted. addExact accepts two nonnegative BigInts and returns their exact sum; wrong types throw TypeError, negative inputs throw RangeError.

Complete the exported stubs in exercise.mjs. The prototype and final stages have separate checks.

Shell
node main.mjs --stage prototype
node main.mjs --stage final

Use Node.js 20+ locally, or the website's browser worker. Tests are standard-library only and check the documented behavior; they do not prove performance or force garbage collection.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.