mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
improved doctests presentation
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user