mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
Remove console.log
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
// https://projecteuler.net/problem=3
|
// https://projecteuler.net/problem=3
|
||||||
const problem = 600851475143
|
|
||||||
|
|
||||||
const largestPrime = (num) => {
|
export const largestPrime = (num = 600851475143) => {
|
||||||
let newnumm = num
|
let newnumm = num
|
||||||
let largestFact = 0
|
let largestFact = 0
|
||||||
let counter = 2
|
let counter = 2
|
||||||
@ -17,4 +16,3 @@ const largestPrime = (num) => {
|
|||||||
}
|
}
|
||||||
return largestFact
|
return largestFact
|
||||||
}
|
}
|
||||||
console.log(largestPrime(problem))
|
|
||||||
|
@ -4,12 +4,13 @@
|
|||||||
* for the target value until a match is found or until all the elements
|
* for the target value until a match is found or until all the elements
|
||||||
* have been searched.
|
* have been searched.
|
||||||
*/
|
*/
|
||||||
function SearchArray (searchNum, ar) {
|
function SearchArray (searchNum, ar, output = v => console.log(v)) {
|
||||||
const position = Search(ar, searchNum)
|
const position = Search(ar, searchNum)
|
||||||
if (position !== -1) {
|
if (position !== -1) {
|
||||||
console.log('The element was found at ' + (position + 1))
|
output('The element was found at ' + (position + 1))
|
||||||
} else {
|
}
|
||||||
console.log('The element not found')
|
else {
|
||||||
|
output('The element not found')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user