You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't create a variable just to return it. This whole body should be a single return statement -1
}
function scramble(word) {
let scrambled = '';
const letters = word.split('');
while (letters.length > 0) {
scrambled += letters.splice(Math.floor(letters.length * Math.random()), 1);
}
return scrambled;
}
function powers(base, limit, callBack) {
for (let i = 1; i <= limit; i *= base) {
callBack(i);
}
}
function* powersGenerator(base, limit) {
for (let i = 1; i <= limit; i *= base) {
yield i; // thanks to joey for helping with the yield
}
}
function say(word) {
if (word === undefined) {
return '';
}
return function chain(nextWord) {
An arrow function would look better -1
if (nextWord) {
return say(`${word} ${nextWord}`);
}
return word;
};
}
function interleave(x, ...y) {
const combined = [];
let combineX = 0;
let combineY = 0;
const comLength = x.length + y.length;
EXTRA CREDIT +2
Use a name other than
temp
-1Don't create a variable just to return it. This whole body should be a single return statement -1
An arrow function would look better -1
comLength
is misleading.maxLength
is better -1Missing -10
Score = 88/100
The text was updated successfully, but these errors were encountered: