<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
10 JSX conditionals, If statements that do work.
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Coin toss doesn’t compile correctly. Can you find the what brackets or curly braces are incorrect?
Correct syntax is the word I’m looking for.
Replace this line with your code.
var React = require('react');
var ReactDOM = require('react-dom');
if (user.age >= drinkingAge) {
var message = (
<h1>
Hey, check out this alcoholic beverage!
</h1>
);
} else {
var message = (
<h1>
Hey, check out these earrings I got at Claire's!
</h1>
);
if (coinToss() == 'heads'){
var img = <img src={pics.kitty} />;
}else{
var img = <img src={pics.doggy} />;
}
}
ReactDOM.render(
message,
document.getElementById('app')
);
hello i’m trying to solve the exercice n10 in React JSX Conditionnals i can’t find the solution
this is my code
if(coinToss() == “heads”) {
var img = (
);
}else{
var img = (
);
}
Chris
and i got this error message Your condition should be if (coinToss() == “heads”) {