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 trialstarr13
2,494 PointsChallenge Task 1 of 1 JavaScript Boolean Value challenge
I am getting an syntax error will working on this challenge. Please look at it and give me some pointers. I can't seem to locate the error or errors.
var randomNumber=Math.floor(Math.random()*6)+ 1;
var guess=prompt("I am thinking of a number between 1 and 6. What is it?")
if (parseInt(guess)===randomNumber{
alert('This is true');
} else {
alert('This is false, The number was ' + randomNumber + ');
}
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
starr13
2,494 PointsThanks to everyone that has assisted me with this new challenge of coding. It's all new to me and I really appreciate the support from the Treehouse Community. I wish you all well and thanks again for the support of learning something new. Julia
Robert Bennett
11,927 PointsHere you go - You where missing: a: ) and: a: ' I ran this on my computer.
<script>
var randomNumber=Math.floor(Math.random()*6)+ 1;
var guess=prompt("I am thinking of a number between 1 and 6. What is it?")
if (parseInt(guess)===randomNumber) {
alert('This is true');
} else {
alert('This is false, The number was ' + randomNumber + '');
}
</script>