improved doctests presentation

This commit is contained in:
marsonya
2020-12-22 23:58:40 +05:30
parent 80c2dc85d7
commit c67a570c45

View File

@ -7,12 +7,16 @@
* Only works for arrays of positive integers. * Only works for arrays of positive integers.
*/ */
// > beadSort([-1, 5, 8, 4, 3, 19]) /**
// ! RangeError: Sequence must be a list of positive integers! * Doctests
// > beadSort([5, 4, 3, 2, 1]) *
// [1, 2, 3, 4, 5] * > beadSort([-1, 5, 8, 4, 3, 19])
// > beadSort([7, 9, 4, 3, 5]) * ! RangeError: Sequence must be a list of positive integers!
// [3, 4, 5, 7, 9] * > beadSort([5, 4, 3, 2, 1])
* [1, 2, 3, 4, 5]
* > beadSort([7, 9, 4, 3, 5])
* [3, 4, 5, 7, 9]
*/
function beadSort (sequence) { function beadSort (sequence) {
// first, let's check that our sequence consists // first, let's check that our sequence consists