JavaScript Quiz: Functions & Arrow Functions

This JavaScript quiz checks the different ways to define a function. You will predict what arrow functions return, see which functions can be called before their line and learn what arrow functions can't do.

आसान 10 सवाल ~5 मिनट पास होने के लिए 80% Node.js 22

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this print?

const double = (n) => n * 2;
console.log(double(4));
जवाब दिखाएं

A. 8 An arrow function with no braces returns its expression automatically. So double(4) returns 4 * 2, which is 8.

इस क्विज़ में क्या है

  • Function declarations, expressions and arrow functions
  • Implicit return in arrow functions, and when braces need return
  • Returning an object literal from an arrow function
  • Missing arguments become undefined
  • Functions as values in arrays and callbacks

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।