Skip to content

Commit ced1b2a

Browse files
committed
Add more to round one.
1 parent 5af6ec8 commit ced1b2a

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

roundOne.js

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
* @param {array} arr - An array of integers
88
*/
99
function leadZeroes(arr) {
10-
// Code here
10+
1111
}
1212

1313
/**
1414
* Setter
1515
* @description: Returns an array of unique numbers.
1616
* Ex: setter([1,1,2,2,3,3]) => [1,2,3]
17-
*
17+
*
1818
* @param {array} arr - An array of data
1919
*/
2020
function setter(arr) {
@@ -25,6 +25,10 @@ function setter(arr) {
2525
* Is Prime
2626
* @description: Return true if the given number is a prime number, false otherwise
2727
* Ex: isPrime(3) => true
28+
*
29+
* Resources:
30+
* https://en.wikipedia.org/wiki/Prime_number
31+
* https://youtu.be/mIStB5X4U8M
2832
* @param num
2933
*/
3034
function isPrime(num) {
@@ -39,21 +43,7 @@ function isPrime(num) {
3943
* @param dividend
4044
* @param divisor
4145
*/
42-
function modulus(dividend, divisor) {
43-
44-
}
45-
46-
/**
47-
* Only Once
48-
* @description: Write a function that takes a function and sets it
49-
* so that it can only be called once. If it's called again it,
50-
* it should return 'undefined' (a string with 'undefined' in it)
51-
* Ex: onlyOnce(someFunction) => 'someFunctions return value'
52-
* someFunction() => 'undefined'
53-
*
54-
* @param {function} fn: A function
55-
*/
56-
function onlyOnce(fn) {
46+
function modulo(dividend, divisor) {
5747

5848
}
5949

@@ -86,8 +76,7 @@ module.exports = {
8676
leadZeroes: leadZeroes,
8777
setter: setter,
8878
isPrime: isPrime,
89-
modulus: modulus,
90-
onlyOnce: onlyOnce,
79+
modulo: modulo,
9180
nextFive: nextFive,
9281
osort: osort
9382
};

0 commit comments

Comments
 (0)