This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function highestStreakInAnArray(result) { | |
let highStreak = 1, | |
currStreak = 1; | |
} | |
for (let i = 0; i < result.length; i++) { | |
if (result[i] === result[i + 1]) { | |
currStreak++; | |
if (currStreak > highStreak) { | |
highStreak = currStreak; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function chunkArrayInGroups(arr, size) { | |
// Break it up. | |
let chunks = arr.length/size; | |
let newArray = []; | |
for (let i = 0; i < chunks ; i++){ | |
let chunkArray= arr.splice(0,size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fibonacci(num) { | |
let count = 1, | |
start = 0, | |
hold, | |
seq = []; | |
while (num >= 0) { | |
hold = count; | |
count = count + start; | |
start = hold; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isIsogram(check){ | |
if (check) { | |
for (let i = 0; i < check.length; i++) { | |
for (let j = i + 1; j < check.length; j++) { | |
if (check[i] === check[j]) return false; | |
} | |
} | |
return true; | |
} | |
return 'Invalid Entry!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iterative solution | |
function pyramid(n) { | |
const midPoint = Math.floor((2 * n - 1) / 2); | |
for (let row = 0; row < n; row++) { | |
let level = ""; | |
for (let column = 0; column < n * 2 - 1; column++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ '/home/chibuzor/.nvm/versions/node/v10.1.0/bin/node', | |
1 verbose cli '/home/chibuzor/.nvm/versions/node/v10.1.0/bin/npm', | |
1 verbose cli 'run', | |
1 verbose cli 'test' ] | |
2 info using npm@6.1.0 | |
3 info using node@v10.1.0 | |
4 verbose run-script [ 'pretest', 'test', 'posttest' ] | |
5 info lifecycle exercism-javascript@0.0.0~pretest: exercism-javascript@0.0.0 | |
6 info lifecycle exercism-javascript@0.0.0~test: exercism-javascript@0.0.0 |