Skip to content

Commit 77af0d8

Browse files
Update exemplar.js
Added stub file's comments for task #3
1 parent 580e1a9 commit 77af0d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

exercises/concept/captains-log/.meta/exemplar.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export function randomShipRegistryNumber() {
1010
return "NCC-"+Math.floor(1000 + Math.random()*9000)
1111
}
12+
1213
/**
1314
* Generates a random stardate.
1415
*
@@ -17,6 +18,12 @@ export function randomShipRegistryNumber() {
1718
export function randomStardate() {
1819
return 41000 + Math.random() * 1000
1920
}
21+
22+
/**
23+
* Generates a random planet class.
24+
*
25+
* @returns {string} a one-letter planet class.
26+
*/
2027
export function randomPlanetClass() {
2128
const planetClasses = ['D', 'H', 'J', 'K', 'L', 'M', 'N', 'R', 'T', 'Y']
2229
return planetClasses[Math.floor(Math.random() * 10)]

0 commit comments

Comments
 (0)