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 trial

JavaScript

var answer = prompt("What is the best programming language?"); if ( answer.toUpperCase ===

var answer = prompt("What is the best programming language?"); if ( answer.toUpperCase === ("RUBY")) { Alert("you are correct") }

2 Answers

Steven Parker
Steven Parker
231,599 Points

You forgot to ask a question, but I'm guessing you want to know why the code snippet doesn't work.

When you call a function or method, you must put parentheses after the name, even if you are not passing any arguments. So instead of "answer.toUpperCase", you should write "answer.toUpperCase()".

I did not work out I have still same problem

Steven Parker
Steven Parker
231,599 Points

Maybe not the "same" problem. :wink:

Instead of "Alert" (with capital "A"), write "alert" (lower-case "a").

To make code in future questions easier to read, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.