Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChad Wright
1,752 Pointswhat is wrong with this javascript code?
if 2=1+1( "yes" )
else (
"miscalculation"
)
6 Answers
toddschneider
4,795 PointsI think your missing your brackets, try this and see if it works for yeah.
if (2 === 1+1){
console.log("yes");
}else{
console.log("miscalculation");
}
hope this helps
toddschneider
4,795 Pointscan you past the entire code your working on?
Stephanie Fuda
7,749 PointsHi, can you try:
else { "miscalculation"; }
Chad Wright
1,752 Pointsthank you. However, it still does not work.
Chad Wright
1,752 Pointsnever mind. I did something wrong. It did work. Thank both of you guys so much. A real life saver.
toddschneider
4,795 Pointsno problem I hope everything works out =D!!!