-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotPrimeNumbers.js
More file actions
51 lines (46 loc) · 1.39 KB
/
Copy pathnotPrimeNumbers.js
File metadata and controls
51 lines (46 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function notPrimes(a, b) {
console.log(a);
console.log(b);
for(let i = 2; i < b; i++) {
if(b % i === 0) {
console.log(i);
} else {
console.log(i);
};
};
};
// function notPrimes(a, b) {
// };
// // strip items up to "a" from resulting array
// let truncOutput = [];
// for (let el in primeOutput) {
// if (primeOutput[el] >= a) {
// truncOutput.push(primeOutput[el]);
// };
// };
// console.log(truncOutput);
// let iString = ''
// let primeArray = [];
// // loop through interval a - b
// for (let i of truncOutput) {
// console.log(i);
// // turn i into a string for parsing
// iString = i.toString();
// iString = iString.replace(0, 'X');
// iString = iString.replace(1, 'X');
// iString = iString.replace(4, 'X');
// iString = iString.replace(6, 'X');
// iString = iString.replace(8, 'X');
// iString = iString.replace(9, 'X');
// console.log(iString);
// //console.log(iString.length);
// // check each stringlet for X and make new array
// if (iString.search('X') === -1) {
// primeArray.push(iString);
// console.log(primeArray);
// };
// };
// return primeArray;
// };
console.log(notPrimes(10, 30));
//console.log(printPrime(10, 30));