-
Notifications
You must be signed in to change notification settings - Fork 44
Sunitha-Sphinx-JS Adagrams #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job on js-adagrams!
export const drawLetters = () => { | ||
// Implement this method for wave 1 | ||
const drawnLetters = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job using const here!
const updatedArr = letterPoolArr.map(([l, freq]) => | ||
l === letter ? [l, freq - 1] : [l, freq] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines are pretty jam packed with logic which makes it a little challenging to decipher. I'd prefer l
to have a more descriptive name to make it easier to read.
word = word.toUpperCase(); | ||
let totalScore = 0; | ||
|
||
for (let i = 0; i < word.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer for
/ of
loop instead since we don't need i
to access each letter in word
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Co-authored-by: Ashley Yang <[email protected]>
Not able to commit changes frequently due to power outage.