Drag the edges to resize the window.

Code Editor

JSX elements are treated as JavaScript expressions. They can go anywhere that JavaScript expressions can go.

That means that a JSX element can be saved in a variable, passed to a function, stored in an object or array...you name it.

Here's an example of a JSX element being saved in a variable:

var navBar = <nav>I am a nav bar</nav>;

Here's an example of several JSX elements being stored in an object:

var Pistons2004 = { center: <li>Ben Wallace</li>, powerForward: <li>Rasheed Wallace</li>, smallForward: <li>Tayshaun Prince</li>, shootingGuard: <li>Richard Hamilton</li>, pointGuard: <li>Chauncey Billups</li> };
Report a Bug
If you see a bug or any other issue with this page, please report it here.