Most important FAQ javascript questions asked so far in indian history list with solutions in Hindi
JavaScript (JS) has become one of the most important programming languages in web development, and many competitive exams, interviews, and coding platforms in India have seen various JavaScript-related questions over the years. While I cannot provide a list of all JavaScript questions ever asked in Indian history, I can provide a collection of important JavaScript questions and answers that have been commonly asked in coding interviews, competitive programming, and technical interviews in India. The solutions are explained in Hindi to help developers in the Indian community.
1. What is JavaScript?
- Answer (Hindi): JavaScript एक high-level programming language है, जिसे web development में primarily client-side scripting के लिए उपयोग किया जाता है। यह language dynamic है, और HTML और CSS के साथ मिलकर interactive web pages बनाने में मदद करती है। JavaScript का मुख्य उद्देश्य web pages को interactive बनाना है। इसके द्वारा आप form validation, event handling, animations, AJAX calls, आदि कर सकते हैं।
2. Explain the difference between null
and undefined
in JavaScript.
- Answer (Hindi):
undefined
: यह एक primitive value है, जो तब मिलता है जब कोई variable declare तो किया जाता है, लेकिन उसे कोई value assign नहीं की जाती है।null
: यह एक intentional assignment है, जो signify करता है कि variable की कोई value नहीं है। इसे explicitly किसी variable को खाली करने के लिए assign किया जाता है।- Example:
3. What are JavaScript data types?
- Answer (Hindi):
JavaScript में दो प्रकार के data types होते हैं:
- Primitive Data Types: ये immutable होते हैं, जैसे:
String
(जैसे: "Hello")Number
(जैसे: 25)BigInt
(जैसे: 123456789123456789n)Boolean
(जैसे: true, false)undefined
null
Symbol
- Non-Primitive Data Types:
Object
(जैसे: {name: "John", age: 30})Array
(जैसे: [1, 2, 3])Function
(जैसे: function myFunction() {...})
- Primitive Data Types: ये immutable होते हैं, जैसे:
4. What is a closure in JavaScript?
- Answer (Hindi):
Closure एक JavaScript function है जो outer function के variables को अपनी inner function में access करने की अनुमति देता है, भले ही outer function execution complete हो चुका हो। Closure का उपयोग state को retain करने और private variables को manage करने के लिए किया जाता है।
- Example:
- Example:
5. Explain Event Delegation in JavaScript.
- Answer (Hindi):
Event delegation वह technique है जहां हम parent element पर event listener attach करते हैं, ताकि child elements पर होने वाले events को handle किया जा सके। इससे event listeners की संख्या कम होती है और performance बेहतर होती है।
- Example:
- Example:
6. What is the difference between ==
and ===
in JavaScript?
- Answer (Hindi):
==
(Loose equality) दो values को compare करते समय type conversion करता है। इसका मतलब है कि अगर values अलग types की भी हों, तो JavaScript उन्हें बराबर मान सकता है।===
(Strict equality) दो values को compare करते समय type conversion नहीं करता है। यदि types different हैं तो ये false return करेगा।- Example:
7. What is hoisting in JavaScript?
- Answer (Hindi):
Hoisting JavaScript की एक behavior है, जिसमें variable और function declarations को उनके scope के top पर ले जाया जाता है, लेकिन variable को undefined और function को उनका body normal तरीके से accessible बन जाता है।
- Example:
- Example:
8. What are Promises in JavaScript?
- Answer (Hindi):
Promise एक JavaScript object है जो asynchronous operation के completion को represent करता है। यह तीन states में हो सकता है:
- Pending: Promise अभी resolved या rejected नहीं हुआ है।
- Resolved: Promise सफलतापूर्वक complete हो गया है।
- Rejected: Promise में error आई है।
- Example:
9. What is the use of bind
, call
, and apply
methods in JavaScript?
- Answer (Hindi):
bind()
: यह method एक नए function को return करता है, जिसमेंthis
context को bind किया जाता है।call()
: यह method function को तुरंत execute करता है औरthis
को explicitly pass करता है।apply()
: यह methodcall()
जैसा ही होता है, लेकिन arguments को array के रूप में pass करता है।- Example:
10. Explain the concept of this
in JavaScript.
- Answer (Hindi):
this
JavaScript में एक special keyword है जो function के context को reference करता है। यह हमेशा function के execution context (calling object) के आधार पर निर्धारित होता है।- Example:
- Example:
11. What is the difference between setTimeout
and setInterval
?
- Answer (Hindi):
setTimeout
: इसे एक बार के लिए delay के बाद execute करने के लिए use किया जाता है। यह केवल एक बार callback function execute करता है।setInterval
: इसे बार-बार execute करने के लिए use किया जाता है। यह function को हर interval के बाद repeat करता है।- Example:
Conclusion
यह केवल कुछ JavaScript से संबंधित महत्वपूर्ण सवाल थे जो Indian interviews और coding platforms में अक्सर पूछे जाते हैं। आपको इन सवालों को समझने और उन्हें implement करने में मदद मिलेगी। इन सवालों के अलावा, JavaScript की दुनिया में और भी बहुत सी advanced topics जैसे कि asynchronous programming, event loop, memory management, design patterns, ES6+ features, और web APIs हैं जिन्हें आपको सीखने की कोशिश करनी चाहिए।
Comments
Post a Comment