hw4-functions-scope #8

Open
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@pmmurray33

pmmurray33 commented Dec 14, 2018

No description provided.


}
checkPalindrome('Racecar');

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

not quite there -- but you're thinking around the right stuff.......
you've kind of overengineered it.
simplify it a bit.
• take in the string
• reverse it
• lowercase it
• if it's the same as the original palindrome, you'er done

console.log(sum);
return sum;

}

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

nice

// //create equation
// const sideC = Math.sqrt((sideA * sideA) + (sideB * sideB));
// return sideC;
// }

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

✔️

sum = sum + parseInt(someNumberArray[i]);
}
return sum;
}

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

nice

//console.log(Math.sqrt(num));
if (num === 2 || num === 3) {
return false;
}

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

whoops! 2 and 3 are both prime

if (num === 2 || num === 3) {
return false;
}
for (let i = 2; i < Math.sqrt(num); i++) {

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

you don't wanna iterate up to a decimal number, iteration requires integers

}
}
console.log(printPrimes(97));

This comment has been minimized.

@reuben

reuben Dec 20, 2018

Contributor

solid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment