JSX Expressions
Any JavaScript expression goes inside curly braces: variables, math, function calls and ternaries. Statements such as if and for do not.
Example
const price = 20;
const view = <p>Total: {price * 2} {price > 10 ? 'High' : 'Low'}</p>;Exercise
Insert a value.
<p>{}</p>
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.