React · Junior · Question 74 of 75
What type does size have in <Avatar size="40" /> versus <Avatar size={40} />?
- ✓Correct answer: A string
"40"in the first, a number40in the second - 2A number in both cases
- 3A string in both cases
Explanation
Quotes pass a string literal; braces pass any JavaScript value. With TypeScript, size: number catches the mistake.