Any help would be appreciated! :p
Thread Tools
Thread Tools
Page 1 of 2
-
You don't need the semicolon for the if and else statements.
Code:if (40 > 39) { console.log("I am right"); } else (40 < 39) { console.log("I am wrong"); } -
rockboy2000 MayorMayor ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade
- Joined:
- Oct 19, 2012
- Messages:
- 1,335
- Trophy Points:
- 54,410
- Gender:
- Male
- EcoDollars:
- $0
- Ratings:
- +310
That's what we all used. -
vdubmastertech BuilderBuilder ⛰️ Ex-Tycoon ⚜️⚜️⚜️
Don't put your variable names in double quotes when you call them in a function.
You only want the first 3 letters so it would be .substring(0-2) , this is because the first letter in the string is actually "0" second is "1" etc. -
When something is in "", then it is considered a string. It should just be myCountry.
Code:var myCounty = ("United States") console.log(myCountry.length); console.log(myCountry.substring(0-2)); -
This wound up being the correct code, but thank you!Code:
var myCountry = ("United States") console.log(myCountry.length); console.log(myCountry.substring(0,3)); -
vdubmastertech BuilderBuilder ⛰️ Ex-Tycoon ⚜️⚜️⚜️
You're welcome. Also if you get stuck just go to the Q&A Forum for that section. It's in the bottom left hand corner. You can usually find the solutions to most of the problems there. If you are like me you probably understand the lesson better by seeing the completed code first and then breaking it down in your head to understand what each part does.
-
vdubmastertech BuilderBuilder ⛰️ Ex-Tycoon ⚜️⚜️⚜️
Yes that's actually correct. Sorry I always forget substring actually uses the last number as the "cut-off" position. -
chocolatecheese1 BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️
EEWWW WHAT LANGUAGE IS THIS?! It looks disgusting... #Java
-
chocolatecheese1 Real men use printf.
Page 1 of 2