--- id: 5a24bbe0dba28a8d3cbd4c5e title: Add Comments in JSX challengeType: 6 isRequired: false --- ## Description
JSX is a syntax that gets compiled into valid JavaScript. Sometimes, for readability, you might need to add comments to your code. Like most programming languages, JSX has its own way to do this. To put comments inside JSX, you use the syntax {/* */} to wrap around the comment text.
## Instructions
The code editor has a JSX element similar to what you created in the last challenge. Add a comment somewhere within the provided div element, without modifying the existing h1 or p elements.
## Tests
```yml tests: - text: The constant JSX should return a div element. testString: 'assert(JSX.type === "div", "The constant JSX should return a div element.");' - text: The div should contain an h1 tag as the first element. testString: 'assert(JSX.props.children[0].type === "h1", "The div should contain an h1 tag as the first element.");' - text: The div should contain a p tag as the second element. testString: 'assert(JSX.props.children[1].type === "p", "The div should contain a p tag as the second element.");' - text: The JSX should include a comment. testString: 'getUserInput => assert(getUserInput("index").includes("/*") && getUserInput("index").includes("*/"), "The JSX should include a comment.");' ```
## Challenge Seed
```jsx const JSX = (

This is a block of JSX

Here's a subtitle

); ```
### After Test
```js console.info('after the test'); ```
## Solution
```js const JSX = (

This is a block of JSX

{ /* this is a JSX comment */ }

Here's a subtitle

); ```