Leaderboard Archive
Javascript Apr 17, 2026

What is the output?

const add = (a, b = 10) => a + b
console.log(add(5))
console.log(add(5, undefined))
console.log(add(5, null))
A 15, 15, 15
B 15, 15, 5
C NaN, NaN, 5
D 5, 5, 5
Explanation
Default params activate when argument is undefined. null is NOT undefined.
📝
Reviewed by CodeShot Editorial
Every challenge is code-reviewed by senior developers to ensure accuracy and real-world relevance. Learn more.

Ready for your shot?

Join thousands of developers solving one logic puzzle every morning.

Solve Today's Challenge →