WDI Fundamentals

WDI Fundamentals Unit 8


Your Turn Your Turn

Check out the sample code in the JS Bin session below. If you don't see the JS Bin, please refresh the page.

JS Bin on jsbin.com

/* Your Expression Here */

This item above is called a comment — it tells a computer to completely ignore everything between the two / characters. There are two kinds of comments: multi-line comments (/* comment */), which can run across multiple lines, and single-line comments (// comment), which only comment out everything following it on the current line.

1) In the console tab (on the right), write an expression that evaluates to the integer 30, then hit enter or return. You can use any expression you like, but it must contain at least one operation (ideally, you'll use two or more).

** Note:** Ensure the *type* of this result is correct — Remember `30` and <code>'30'</code> are not the same!

2) Now, replace your first expression with a second expression. This one should evaluate to 'Hello World'.

3) Finally, replace the previous expression with an expression that evaluates to the Boolean true. Try using two or three operations for this one!

Stuck? Check out the solutions to see what you can do.


On to the next lesson!