could you please help with finding the right answer for the quiz question:
What do you call the message wrapped in curly braces below?
let message = "Hi there";
const element = <p>{message}</p>
a. JS function
b. JS element
c. JS expression
d. JSX wrapper
Is the right answer "JSX wrapper" or "JS expression" reference link from the official docs .html
could you please help with finding the right answer for the quiz question:
What do you call the message wrapped in curly braces below?
let message = "Hi there";
const element = <p>{message}</p>
a. JS function
b. JS element
c. JS expression
d. JSX wrapper
Is the right answer "JSX wrapper" or "JS expression" reference link from the official docs https://reactjs/docs/introducing-jsx.html
Share Improve this question asked Aug 10, 2020 at 9:01 Evgenii BazhanovEvgenii Bazhanov 9261 gold badge7 silver badges20 bronze badges2 Answers
Reset to default 6That's just a JS Expression wrapped in JSX. So, the right answer is c
.
You can take reference: JSX is an Expression Too
JSX Wrapper is nothing but JSX Element like we can call wrapper to html element that is root of. So, the JSX wrapper is JS Expression wrapping element. In the example <p />
is what you may call JSX wrapper.
The message wrapped in curly braces below:
let message = "Hi there"; const element = <p>{message}</p>
The right answer is: (c.) JS expression