Q. What is the default state of a new useState variable?

Code:
const [count, setCount] = useState();
  • (A) 0
  • (B) undefined
  • (C) null
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (B) undefined
Explanation: If no argument is passed to useState, the default state is undefined.
Explanation by: Mr. Dubey
If no argument is passed to useState, the default state is undefined.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
221
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate