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!
All submissions in ONE submission
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:
git checkout master
git branch -D p2
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
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
.
const solution = a => {
if (a > 5) {
return true;
}
return false;
};
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
if (a > b) {
return true;
}
return false;
if (a + b > 10) {
return true;
}
return false;