पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
JavaScript कोड चलाने की ज़िम्मेदारी किसकी है?
Which one is responsible for running JavaScript code?
ABrowser
BNotepad++
CSublime Text
DVisual Studio Code
सही उत्तर / Answer: (A)
हल / Solution
वेब पेज की JavaScript को browser चलाता है। हर browser में एक JavaScript engine होता है, जैसे Chrome में V8, जो कोड पढ़कर उसे चलाता है और पेज पर नतीजा दिखाता है। Notepad++, Sublime Text और Visual Studio Code code editor हैं। इनमें हम कोड लिखते और सहेजते हैं, पर ये ख़ुद वेब पेज की JavaScript नहीं चलाते। इसलिए कोड चलाने की ज़िम्मेदारी browser की है और सही उत्तर Browser है।
The JavaScript of a web page is run by the browser. Every browser has a JavaScript engine, such as V8 in Chrome, which reads the code, runs it and shows the result on the page. Notepad++, Sublime Text and Visual Studio Code are code editors. We write and save code in them, but they do not run a web page's JavaScript themselves. So running the code is the browser's job, and the answer is Browser.
प्रश्न 2उत्तर + हल
JavaScript किसने विकसित की?
Who developed JavaScript?
ABrendan Eich
BBrendan Rich
CJohn Eckert
DJohn Mauchly
सही उत्तर / Answer: (A)
हल / Solution
JavaScript को सन् 1995 में Netscape कंपनी में Brendan Eich ने बनाया था। कहा जाता है कि उन्होंने इसका पहला रूप सिर्फ़ दस दिनों में तैयार किया था। बाद में उन्होंने Mozilla की शुरुआत में भी बड़ा हाथ बँटाया। Brendan Rich नाम मिलता-जुलता है, पर ग़लत है। John Eckert और John Mauchly ने शुरुआती कंप्यूटर ENIAC बनाया था, JavaScript से उनका कोई संबंध नहीं। इसलिए सही उत्तर Brendan Eich है।
JavaScript was created in 1995 by Brendan Eich at the Netscape company. He is said to have built its first version in just ten days, and he later helped found Mozilla. Brendan Rich is a look-alike name and is wrong. John Eckert and John Mauchly built ENIAC, one of the earliest computers, and had nothing to do with JavaScript. So the correct answer is Brendan Eich, the first option.
प्रश्न 3उत्तर + हल
JavaScript कोड ___ extension वाली फ़ाइल के अंदर लिखा जाता है।
JavaScript code is written inside a file having the extension ___.
A
B
C
D
सही उत्तर / Answer: (A)
हल / Solution
JavaScript की अलग फ़ाइल का extension .js होता है, जैसे main.js। web server भी .js फ़ाइल को पहचानकर browser को बताता है कि यह JavaScript है। फिर HTML में <script src="main.js"> लिखकर उसे जोड़ा जाता है। .jvs और .jsc कोई मानक extension नहीं हैं। .javaScript बहुत लंबा है और JavaScript फ़ाइलों के लिए इस्तेमाल नहीं होता। इसलिए सही उत्तर .js है।
A separate JavaScript file uses the .js extension, for example main.js. The web server also recognises a .js file and tells the browser that it holds JavaScript. It is then linked in HTML with <script src="main.js">. The extensions .jvs and .jsc are not standard. The extension .javaScript is far too long and is not used for JavaScript files. So the correct answer is the first option, .js.
प्रश्न 4उत्तर + हल
JavaScript में entities ___ से शुरू होती हैं और ___ पर ख़त्म होती हैं।
JavaScript entities start with ___ and end with ___.
Acomma, colon
Bcolon, semicolon
Campersand, semicolon
Dsemicolon, ampersand
सही उत्तर / Answer: (C)
हल / Solution
Entity किसी ख़ास अक्षर को लिखने का कोड होता है, जिसे सीधे टाइप करने पर गड़बड़ी हो सकती है। यह हमेशा ampersand (&) से शुरू होता है और semicolon (;) पर ख़त्म होता है। जैसे < से < बनता है, > से > और & से ख़ुद & बनता है। comma और colon से कोई entity नहीं बनती। चौथे विकल्प में क्रम उल्टा है। इसलिए सही उत्तर ampersand, semicolon है।
An entity is a code for writing a special character that could cause trouble if typed directly. It always starts with an ampersand (&) and ends with a semicolon (;). For example, < gives <, > gives > and & gives the & itself. No entity uses a comma or a colon. The fourth option has the right marks in the wrong order. So the correct answer is ampersand, semicolon.
प्रश्न 5उत्तर + हल
हम JavaScript को किस HTML element के अंदर लिखते हैं?
Inside which HTML element do we put the JavaScript?
A
B
C
D
सही उत्तर / Answer: (A)
हल / Solution
HTML पेज में JavaScript का कोड <script> और </script> के बीच लिखा जाता है। browser जब यह टैग देखता है, तो उसके अंदर का कोड JavaScript engine को चलाने के लिए देता है। इसे <head> या <body> दोनों में रखा जा सकता है। <js>, <javascript> और <scripting> नाम के कोई HTML टैग होते ही नहीं, browser उन्हें पहचानता नहीं। इसलिए सही उत्तर <script> है।
In an HTML page, JavaScript code is written between <script> and </script>. When the browser sees this tag, it hands the code inside to its JavaScript engine to run. The tag can be placed in the <head> or the <body>. There are no HTML tags named <js>, <javascript> or <scripting>, and the browser does not recognise them. So the correct answer is the <script> element.
प्रश्न 6उत्तर + हल
JavaScript और Java के नाम मिलते-जुलते क्यों हैं?
Why do JavaScript and Java have similar names?
AJavaScript का syntax कुछ हद तक Java पर आधारित हैJavaScript's syntax is loosely based on Java's.
BJava और JavaScript एक ही हैंJava and JavaScript are the same.
CJavaScript और Java एक ही कंपनी ने बनाईJavaScript and Java were developed by the same company.
DJavaScript और Java का आविष्कार एक ही व्यक्ति ने कियाJavaScript and Java were invented by the same person.
सही उत्तर / Answer: (A)
हल / Solution
JavaScript का syntax, जैसे { } से block बनाना, if, for और while लिखने का ढंग, कुछ हद तक Java जैसा रखा गया था, और उस समय Java बहुत लोकप्रिय थी। इसीलिए नाम भी मिलता-जुलता रखा गया। पर दोनों अलग भाषाएँ हैं। Java को Sun Microsystems में James Gosling ने बनाया, जबकि JavaScript को Netscape में Brendan Eich ने। इसलिए कंपनी और आविष्कारक वाले विकल्प ग़लत हैं। सही उत्तर पहला विकल्प है।
JavaScript's syntax, such as blocks in { } and the way if, for and while are written, was kept loosely similar to Java, which was very popular at the time. That is why the name was also made similar. But they are two different languages. Java was created by James Gosling at Sun Microsystems, while JavaScript was created by Brendan Eich at Netscape. So the company and inventor options are wrong. The first option is correct.
प्रश्न 7उत्तर + हल
JavaScript किस काम के लिए आदर्श है?
JavaScript is ideal to
AHTML में गणनाओं को सरल बनाने के लिएmake computations in HTML simpler.
Bweb server पर storage की ज़रूरत कम करने के लिएminimize storage requirements on the web server.
Cclient के लिए download समय बढ़ाने के लिएincrease the download time for the client.
Dउल्लिखित में से कोई नहींNone of the mentioned.
सही उत्तर / Answer: (B)
हल / Solution
JavaScript का बहुत-सा काम user के browser में होता है, जैसे form की जाँच, पेज के हिस्से बदलना और छोटी गणनाएँ। इससे server को हर छोटे काम के लिए अलग पेज, फ़ाइलें या data सँभालकर नहीं रखने पड़ते, यानी server पर storage और बोझ की ज़रूरत घटती है। HTML ख़ुद गणना करता ही नहीं, इसलिए पहला विकल्प ठीक नहीं बैठता। download समय बढ़ाना कोई फ़ायदा नहीं, नुक़सान है। इसलिए दूसरा विकल्प सही है।
Much of JavaScript's work happens in the user's browser, such as checking forms, changing parts of the page and doing small calculations. So the server does not have to keep separate pages, files or data for every small task, which reduces the storage and load needed on the web server. HTML itself does no computing, so the first option does not fit. Increasing download time is a drawback, not a benefit. So the second option is correct.
प्रश्न 8उत्तर + हल
Unix मशीन पर बनाया गया एक JavaScript प्रोग्राम
A JavaScript program developed on a Unix machine
Aerrors और exceptions देगाwill throw errors and exceptions.
Bसिर्फ़ UNIX मशीन तक ही सीमित रहना चाहिएmust be restricted to a UNIX machine only.
CWindows मशीन पर भी पूरी तरह ठीक चलेगाwill work perfectly well on a Windows machine.
Dbrowser पर JavaScript text के रूप में दिखेगाwill be displayed as JavaScript text on the browser.
सही उत्तर / Answer: (C)
हल / Solution
JavaScript का कोड किसी operating system पर नहीं, browser के अंदर के engine पर चलता है। इसलिए कोड Unix पर लिखा गया हो या कहीं और, Windows, Mac या मोबाइल के browser में वह वैसे ही चलेगा। इसे platform independent होना कहते हैं। Unix पर बनने से कोई error नहीं आती और न ही वह Unix तक बँधा रहता है। सही <script> टैग में हो तो कोड text के रूप में नहीं दिखता, चलता है।
JavaScript code does not run on the operating system directly; it runs on the engine inside the browser. So whether the code was written on Unix or anywhere else, it will run the same way in a browser on Windows, Mac or a phone. This is called being platform independent. Being written on Unix causes no errors and does not tie it to Unix. Inside a proper <script> tag, the code runs rather than showing as text.
प्रश्न 9उत्तर + हल
किसी खास शर्त (condition) को जाँचने के लिए ____ कथन का उपयोग किया जाता है।
Using the ____ statement is how you test for a specific condition.
ASelect
BIf
CSwitch
DFor
सही उत्तर / Answer: (B)
हल / Solution
JavaScript में किसी शर्त को जाँचने का मूल तरीका if कथन है, जैसे if (age >= 18) { ... }। शर्त सच हो तो अंदर का कोड चलता है, नहीं तो छूट जाता है। switch किसी शर्त को नहीं, एक ही मान को कई case से मिलाता है। for लूप कोड को बार-बार दोहराने के लिए है। Select JavaScript का कोई कथन ही नहीं है, यह SQL का शब्द है। इसलिए सही उत्तर If है।
The basic way to test a condition in JavaScript is the if statement, for example if (age >= 18) { ... }. If the condition is true, the code inside runs; otherwise it is skipped. switch does not test a condition; it matches one value against several cases. The for statement is a loop for repeating code. Select is not a JavaScript statement at all; it is an SQL keyword. So the correct answer is If.
प्रश्न 10उत्तर + हल
JavaScript का समर्थन करने वाला पहला web browser कौन-सा था?
Which was the first web browser to support JavaScript?
AIE
BGoogle Chrome
CNetscape
DMozilla Firefox
सही उत्तर / Answer: (C)
हल / Solution
JavaScript को Netscape कंपनी ने अपने browser के लिए बनाया था। इसलिए सबसे पहले यह Netscape Navigator 2.0 में आई, जो सन् 1996 में जारी हुआ। Internet Explorer (IE) में JavaScript जैसी भाषा JScript के रूप में बाद में, IE 3.0 में आई। Mozilla Firefox सन् 2004 में और Google Chrome सन् 2008 में आए, यानी बहुत बाद में। इसलिए JavaScript चलाने वाला पहला browser Netscape था।
JavaScript was built by the Netscape company for its own browser. So it first appeared in Netscape Navigator 2.0, released in 1996. Internet Explorer got a similar language, JScript, only later, in IE 3.0. Mozilla Firefox came in 2004 and Google Chrome in 2008, long after that. So the first web browser to support JavaScript was Netscape, and the other three options came later.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
JavaScript को lightweight प्रोग्रामिंग भाषा क्यों कहा जाता है?
Why is JavaScript called a lightweight programming language?
Aक्योंकि JS client side scripting हैBecause JS is client side scripting
Bक्योंकि JS मुफ़्त में उपलब्ध हैBecause JS is available free of cost
Cक्योंकि हम JS के अंदर programming सुविधाएँ जोड़ सकते हैंBecause we can add programming functionality inside JS
Dक्योंकि JS अंदर programming सुविधाएँ देती है, पर एक सीमा तक हीBecause JS can provide programming functionality inside, but only up to a certain extent