Skip to content

Commit 87a3da7

Browse files
committed
Remove console.log
1 parent 9218a5c commit 87a3da7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Project-Euler/Problem3.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// https://projecteuler.net/problem=3
2-
const problem = 600851475143
32

4-
const largestPrime = (num) => {
3+
export const largestPrime = (num = 600851475143) => {
54
let newnumm = num
65
let largestFact = 0
76
let counter = 2
@@ -17,4 +16,3 @@ const largestPrime = (num) => {
1716
}
1817
return largestFact
1918
}
20-
console.log(largestPrime(problem))

Search/LinearSearch.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* for the target value until a match is found or until all the elements
55
* have been searched.
66
*/
7-
function SearchArray (searchNum, ar) {
7+
function SearchArray (searchNum, ar, output = v => console.log(v)) {
88
const position = Search(ar, searchNum)
99
if (position !== -1) {
10-
console.log('The element was found at ' + (position + 1))
11-
} else {
12-
console.log('The element not found')
10+
output('The element was found at ' + (position + 1))
11+
}
12+
else {
13+
output('The element not found')
1314
}
1415
}
1516

0 commit comments

Comments
 (0)