FliQi Education App Download
प्रश्न-बैंक · Web Technology

JS Syntax & String & Variable — प्रश्न और उत्तर

Web Technology · 136 जाँचे हुए (verified) प्रश्न

  • 136 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
JavaScript कोड चलाने की ज़िम्मेदारी किसकी है?
Which one is responsible for running JavaScript code?
  1. ABrowser
  2. BNotepad++
  3. CSublime Text
  4. 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?
  1. ABrendan Eich
  2. BBrendan Rich
  3. CJohn Eckert
  4. 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 ___.
  1. Aप्रश्न का चित्र
  2. Bप्रश्न का चित्र
  3. Cप्रश्न का चित्र
  4. 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 ___.
  1. Acomma, colon
  2. Bcolon, semicolon
  3. Campersand, semicolon
  4. Dsemicolon, ampersand

सही उत्तर / Answer: (C)

हल / Solution
Entity किसी ख़ास अक्षर को लिखने का कोड होता है, जिसे सीधे टाइप करने पर गड़बड़ी हो सकती है। यह हमेशा ampersand (&) से शुरू होता है और semicolon (;) पर ख़त्म होता है। जैसे &lt; से < बनता है, &gt; से > और &amp; से ख़ुद & बनता है। 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, &lt; gives <, &gt; gives > and &amp; 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?
  1. Aप्रश्न का चित्र
  2. Bप्रश्न का चित्र
  3. Cप्रश्न का चित्र
  4. 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?
  1. AJavaScript का syntax कुछ हद तक Java पर आधारित हैJavaScript's syntax is loosely based on Java's.
  2. BJava और JavaScript एक ही हैंJava and JavaScript are the same.
  3. CJavaScript और Java एक ही कंपनी ने बनाईJavaScript and Java were developed by the same company.
  4. 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
  1. AHTML में गणनाओं को सरल बनाने के लिएmake computations in HTML simpler.
  2. Bweb server पर storage की ज़रूरत कम करने के लिएminimize storage requirements on the web server.
  3. Cclient के लिए download समय बढ़ाने के लिएincrease the download time for the client.
  4. 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
  1. Aerrors और exceptions देगाwill throw errors and exceptions.
  2. Bसिर्फ़ UNIX मशीन तक ही सीमित रहना चाहिएmust be restricted to a UNIX machine only.
  3. CWindows मशीन पर भी पूरी तरह ठीक चलेगाwill work perfectly well on a Windows machine.
  4. 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.
  1. ASelect
  2. BIf
  3. CSwitch
  4. 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?
  1. AIE
  2. BGoogle Chrome
  3. CNetscape
  4. 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 — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
Local variables तभी नष्ट हो जाते हैं जब _____
Local variables are destroyed as soon as _____
  1. Acontrol method से बाहर आ जाता हैcontrol comes outside the method.
  2. Buser browser बंद कर देता हैthe user closes the browser.
  3. Cपेज पूरी तरह load हो जाता हैthe page gets completely loaded.
  4. Dइनमें से कोई नहींNone of these.
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
JavaScript variable के नाम में कौन-सा वर्ण पहले अक्षर के रूप में नहीं आ सकता, पर पहले अक्षर के बाद आ सकता है?
Which character cannot be used as the first character of a JavaScript variable name but can be used after the first character?
  1. AUnderscore (_)
  2. BAsterisk (*)
  3. CDigit (अंक)Digit
  4. DDollar Sign ($)
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
JavaScript में स्पेस और विराम चिह्नों को ___ प्रतीक (symbols) कहा जाता है।
Spaces and punctuation marks are called ___ symbols in JavaScript.
  1. APunctual
  2. BSpecial (विशेष)Special
  3. CMandatory (अनिवार्य)Mandatory
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
Script की चलने लायक (executable) एक पंक्ति को ___ कहा जाता है।
An executable single line of script is called ___
  1. AJS में BreakpointBreakpoint in JS
  2. BJavaScript में Statement (कथन)Statement in JavaScript
  3. CJS में LineLine in JS
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
बाहरी script फ़ाइल में इस्तेमाल हुई character encoding बताने के लिए ____ attribute का उपयोग होता है।
The ____ attribute is used to specify the character encoding used in an external script file.
  1. Atype
  2. Bcharacter
  3. Ccharset
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
कौन-सा attribute यह बताता है कि script तब चलाई जाए जब पेज की parsing पूरी हो जाए (सिर्फ़ बाहरी script के लिए)?
Which attribute specifies that the script is executed when the page has finished parsing (only for external scripts)?
  1. Aasync
  2. Bdefer
  3. Cparse
  4. Dtype
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
आपके HTML दस्तावेज़ में बाहरी (external) JS कोड जोड़ने के लिए निम्न में से कौन-सा attribute इस्तेमाल होता है?
Which of the following attributes is used to include external JS code inside your HTML document?
  1. Asrc
  2. Bext
  3. Clink
  4. Dscript
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
JavaScript को lightweight प्रोग्रामिंग भाषा क्यों कहा जाता है?
Why is JavaScript called a lightweight programming language?
  1. Aक्योंकि JS client side scripting हैBecause JS is client side scripting
  2. Bक्योंकि JS मुफ़्त में उपलब्ध हैBecause JS is available free of cost
  3. Cक्योंकि हम JS के अंदर programming सुविधाएँ जोड़ सकते हैंBecause we can add programming functionality inside JS
  4. Dक्योंकि JS अंदर programming सुविधाएँ देती है, पर एक सीमा तक हीBecause JS can provide programming functionality inside, but only up to a certain extent
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
आपके HTML में JavaScript इस्तेमाल करने की लागत ____ है।
The cost of using JavaScript in your HTML is ____.
  1. Aयह मुफ़्त हैIt's free
  2. B$10 प्रति वर्ष$10 per year
  3. C$5 प्रति वर्ष$5 per year
  4. D$15 प्रति वर्ष$15 per year
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
JS Syntax & String & Variable के सभी 136 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

Web Technology के दूसरे topics

सभी topics