JS0 Challenges

These are things to watch out for. Make sure you are not making the same mistakes, and please help us teach new students to avoid the following mistakes!

  1. All submissions in ONE submission

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b5f8b0ac-6852-4728-ad59-3277c56f50ef/Screen_Shot_2019-12-19_at_10.29.03_PM.png

  2. Incorrect branching

    branching issues. It is important to do branching correctly because we use it extensively in the industry. Treat each problem as a new feature. You are creating each problem as the same feature.

    You have to redo this problem, and the steps are:

    1. go to master: git checkout master
    2. Delete the branch that is wrong (say p2): git branch -D p2
    3. Create the branch: git checkout -b p2

    Then you can continue solving and submitting each problem. Make sure to read js0 submission instructions! https://www.notion.so/JS-0-Foundations-a43ca620e54945b2b620bcda5f3cf672#88ecd4ac99d341789c2e0b049c13c017

  3. No const or let during declaration

    const num3 = num1 + num2

    You must always declare variables with const in front. If you can't use const, use let.

3.js - Greater than 5

const solution = a => {
  if (a > 5) {
    return true;
  }
  return false;
};

5.js - Biggest num out of 3

if(a > b || a > c)
  { 
    return a;
  }
  if(b > a || b > c)
  {
    return b;
  }
  else{
    return c;
  }

Double tertiary is considered lousy code because of how hard it is to understand. When you are writing code, you are not doing it for yourself. Instead, you are writing it so another beginner may take over your code one day and add on to your legacy. For this reason, most reputable companies will reject this code.

if (num1 > num 2 && num 1 > num3) {
  return num1
}
if (num2> num3) {
  return num2
}
return num3

6.js - Is First Num Bigger

if (a > b) {
  return true;
}
return false;

7.js - Sum > 10

if (a + b > 10) {
  return true;
}
return false;

Challenges