Skip to content

Commit c67a570

Browse files
committed
improved doctests presentation
1 parent 80c2dc8 commit c67a570

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Sorts/BeadSort.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
* Only works for arrays of positive integers.
88
*/
99

10-
// > beadSort([-1, 5, 8, 4, 3, 19])
11-
// ! RangeError: Sequence must be a list of positive integers!
12-
// > beadSort([5, 4, 3, 2, 1])
13-
// [1, 2, 3, 4, 5]
14-
// > beadSort([7, 9, 4, 3, 5])
15-
// [3, 4, 5, 7, 9]
10+
/**
11+
* Doctests
12+
*
13+
* > beadSort([-1, 5, 8, 4, 3, 19])
14+
* ! RangeError: Sequence must be a list of positive integers!
15+
* > beadSort([5, 4, 3, 2, 1])
16+
* [1, 2, 3, 4, 5]
17+
* > beadSort([7, 9, 4, 3, 5])
18+
* [3, 4, 5, 7, 9]
19+
*/
1620

1721
function beadSort (sequence) {
1822
// first, let's check that our sequence consists

0 commit comments

Comments
 (0)