5 hands-on exercises and 5 find-the-bug challenges for the Expressions in JSX lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Display a variable inside JSX with braces.
Show the result of an arithmetic expression.
Show a name in uppercase using a method call inside braces.
Show returning when visits is above one, otherwise first time.
Build a greeting string before the return and display it.
Without braces the variable name is printed as literal text.
Quoting the braces makes them part of the string.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceZero is falsy but React renders it, so && puts a bare 0 on the page.
Braces take an expression; an if statement does not compile.
The branches are swapped, so the wrong message shows.