Js1 Challenge Reviews

These submissions could be improved. Make sure you are not making the same mistakes.

Bad Branch updates

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3b84aff4-4cfe-40de-bb70-d505ccf732c5/Screen_Shot_2020-01-05_at_7.20.13_PM.png

you MAY get this issue: nothing to submit. If you do, you have merged your submission into master accidentally. To fix that issue:

  1. go to master: git checkout master
  2. open the file, delete the code that is not supposed to be there. git add the file and commit
  3. Go back to branch file: git checkout your-branch
  4. Merge in master's change: git merge master
  5. Redo the problem, then resubmit.

For loops

To prepare students for later chapters, we need to make sure students are well versed with recursion for these easy problems. Please redo your submissions using a recursive solution so you don't get lost in the later chapters.

Here's the section that talks about recursion: https://www.notion.so/JS-1-HTML-Functions-01dd8400b85f40d083966908acbfa184#be2575b8b21f4d97a0870c5e0ec01b09

10.js

const solution = (str, fun) => {
  let i=0
  return () => {
    if (i >= str.length) {
      i=0
    }
    let res = fun(str[i])
    i+=1
    return res
  }
}

IsPrime

if (num <= 2) 
    return (num === 2) ? true : false;

This code has nested if logic, makes it hard for the next reviewer to follow your logic. Next time, try to identify complicated logic yourself and spending time thinking about it to make your code cleaner.