Language Features Magic Quiz

Test your knowledge of Language Features by answering this quiz!
Question 1 of 1

Given the following in React:

const [name, setName] = useState('');

useEffect(() => {
  console.log(name);
}, []);

return (
  <Button onClick={() => { setName('Jack'); }>
    {name}
  </Button>
);

What happens when you click the rendered button?


  • Nothing
  • The rendered text within Button will change to Jack.
  • The rendered text within Button will change to Jack and will print Jack in the developer console.
  • Infinite loop
How do you stack up?
My Progress
Percentage of Total Answers Correct
0 / 0
0%

Breakdown by Tag
0 / 0
0%
0 / 0
0%