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

Object and Array — प्रश्न और उत्तर

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

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

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

भाषा
प्रश्न 1उत्तर + हल
किसी ऑब्जेक्ट का इंस्टेंस बनाने के लिए ________ ऑपरेटर का उपयोग किया जाता है।
The ________ operator is used to create an instance of an object.
  1. Athis
  2. Bself
  3. Cfind
  4. Dnew

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

हल / Solution
new ऑपरेटर किसी ऑब्जेक्ट का नया इंस्टेंस बनाता है। यह पहले एक ख़ाली ऑब्जेक्ट बनाता है, फिर constructor function चलाता है जिसमें this उसी नए ऑब्जेक्ट को दर्शाता है, और अंत में वह ऑब्जेक्ट लौटा देता है। जैसे let today = new Date(); से एक नया Date ऑब्जेक्ट बनता है। this सिर्फ़ वर्तमान ऑब्जेक्ट को दर्शाता है, कुछ बनाता नहीं। self और find ऑब्जेक्ट बनाने वाले ऑपरेटर नहीं हैं। इसलिए सही उत्तर new है।
The new operator creates an instance of an object. It builds a fresh empty object, runs the constructor function with this set to that object, and then returns it. For example, let today = new Date(); makes a new Date object. The this keyword only refers to the current object and does not create anything. self and find are not JavaScript operators for creating objects. So the correct answer is new.
प्रश्न 2उत्तर + हल
DOM एक _________ मानक है।
The DOM is a ____________ standard.
  1. AWWW
  2. BW3C
  3. CW3B
  4. DWMB

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

हल / Solution
DOM (Document Object Model) एक W3C मानक है। W3C यानी World Wide Web Consortium वह संस्था है जो HTML, CSS और DOM जैसे वेब मानक तय करती है। DOM किसी वेब पेज को ऑब्जेक्ट के एक पेड़ (tree) के रूप में दिखाता है। इसी से जावास्क्रिप्ट पेज की सामग्री, ढाँचा और स्टाइल पढ़ और बदल पाती है। WWW ख़ुद वेब है, कोई मानक संस्था नहीं। W3B और WMB गढ़े हुए नाम हैं।
The DOM (Document Object Model) is a W3C standard. W3C, the World Wide Web Consortium, is the body that sets web standards such as HTML, CSS and the DOM. The DOM shows a web page as a tree of objects, so that JavaScript can read and change its content, structure and style. WWW is the web itself, not a standards body, while W3B and WMB are made-up names with no such role.
प्रश्न 3उत्तर + हल
पदानुक्रम में सबसे ऊपर कौन-सा ऑब्जेक्ट है?
Which object is at the top of the hierarchy?
  1. Aफ़ॉर्म कंट्रोल एलिमेंट (Form Control Elements)Form Control Elements
  2. Bडॉक्यूमेंट ऑब्जेक्ट (Document Object)Document Object
  3. Cफ़ॉर्म ऑब्जेक्ट (Form Object)Form Object
  4. Dविंडो ऑब्जेक्ट (Window Object)Window Object

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

हल / Solution
ब्राउज़र के ऑब्जेक्ट पदानुक्रम में window ऑब्जेक्ट सबसे ऊपर होता है। यह ब्राउज़र की विंडो या टैब को दर्शाता है। बाक़ी सब ऑब्जेक्ट इसी के नीचे आते हैं। window.document, डॉक्यूमेंट ऑब्जेक्ट है। डॉक्यूमेंट के भीतर फ़ॉर्म, फ़ॉर्म ऑब्जेक्ट बनकर रहता है। टेक्स्ट बॉक्स और बटन उस फ़ॉर्म के भीतर के कंट्रोल एलिमेंट हैं। यानी क्रम है — window, फिर document, फिर form, फिर form के कंट्रोल। इसलिए सबसे ऊपर window है।
In the browser object hierarchy, the window object sits at the top. It stands for the browser window or tab. All other objects hang below it: window.document is the Document object, a form lives inside the document as a Form object, and text boxes and buttons are form control elements inside that form. So the order runs window, then document, then form, then form controls, and window is at the top.
प्रश्न 4उत्तर + हल
जावास्क्रिप्ट में "this" कीवर्ड का क्या अर्थ है?
What is meant by the "this" keyword in JavaScript?
  1. Aयह वर्तमान ऑब्जेक्ट को दर्शाता हैIt refers current object
  2. Bयह पिछले ऑब्जेक्ट को दर्शाता हैIt refers previous object
  3. Cयह एक variable है जिसमें मान रहता हैIt is variable which contains value
  4. Dउपरोक्त में से कोई नहींNone of the above

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

हल / Solution
this कीवर्ड वर्तमान ऑब्जेक्ट को दर्शाता है, यानी वह ऑब्जेक्ट जो उस समय कोड चला रहा है। किसी method के भीतर this उसी ऑब्जेक्ट की ओर इशारा करता है जिसका वह method है। जैसे car = { brand: "Tata", show: function () { return this.brand; } } में car.show() चलाने पर "Tata" मिलता है। this कभी पिछले ऑब्जेक्ट को नहीं दर्शाता। यह एक कीवर्ड है, मान रखने वाला सामान्य variable नहीं।
The this keyword refers to the current object, that is, the object that is running the code. Inside a method, this points to the object that owns the method, so this.brand reads that object's brand property. For example, with let car = { brand: "Tata", show: function () { return this.brand; } }, the call car.show() returns "Tata". It never means a previous object, and it is a keyword, not an ordinary variable.
प्रश्न 5उत्तर + हल
document ऑब्जेक्ट के लिए capture events method का सिंटैक्स ____ है।
The syntax of the capture events method for document objects is ____
  1. Aप्रश्न का चित्र
  2. Bप्रश्न का चित्र
  3. Cप्रश्न का चित्र
  4. Dप्रश्न का चित्र

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

हल / Solution
Netscape इवेंट मॉडल में document ऑब्जेक्ट का सिंटैक्स document.captureEvents(eventType) है। eventType बताता है कि कौन-से इवेंट पकड़ने हैं, जैसे Event.CLICK। कई प्रकार | ऑपरेटर से जोड़े जा सकते हैं, जैसे Event.CLICK | Event.KEYPRESS। ख़ाली कोष्ठक से कोई इवेंट तय ही नहीं होता। "capture Events" में बीच की जगह के कारण method का नाम ही ग़लत है। यहाँ argument इवेंट का प्रकार होता है, इवेंट का मान नहीं।
In the Netscape event model, the document object uses the syntax document.captureEvents(eventType). The eventType argument names the events to catch, such as Event.CLICK, and several types can be joined with the | operator, like Event.CLICK | Event.KEYPRESS. An empty call names no event to capture. "capture Events" with a space is not a valid method name, and the argument is an event type, not an event value.
प्रश्न 6उत्तर + हल
एक _____ ऑब्जेक्ट किसी Java package की classes में से एक class का संदर्भ है, जैसे netscape.javascript में।
A _____ object is a reference to one of the classes in a Java package, such as netscape.javascript.
  1. AJavaArray
  2. BJavaClass
  3. CJavaObject
  4. DJavaPackage

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

हल / Solution
LiveConnect में हर तरह की Java चीज़ का जावास्क्रिप्ट में अपना wrapper होता है। JavaClass ऑब्जेक्ट किसी Java package के भीतर की एक class का संदर्भ है, जैसे netscape.javascript की JSObject class। इसके ज़रिए static field और method इस्तेमाल किए जा सकते हैं और नए instance भी बनाए जा सकते हैं। JavaPackage ख़ुद package को, JavaObject एक instance को और JavaArray एक Java array को दर्शाता है। इसलिए उत्तर JavaClass है।
In LiveConnect, each kind of Java item gets its own wrapper in JavaScript. A JavaClass object is a JavaScript reference to one class inside a Java package, for example the JSObject class of netscape.javascript. Through it you can use static fields and methods or create new instances. JavaPackage refers to the package itself, JavaObject to a single instance, and JavaArray to a Java array. So the answer is JavaClass.
प्रश्न 7उत्तर + हल
____ एक wrapped (लपेटा हुआ) Java array है, जिसे जावास्क्रिप्ट कोड के भीतर से एक्सेस किया जाता है।
____ is a wrapped Java array, accessed from within JavaScript code.
  1. AJavaArray
  2. BJavaClass
  3. CJavaObject
  4. DJavaPackage

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

हल / Solution
LiveConnect में जावास्क्रिप्ट के भीतर इस्तेमाल होने वाली Java चीज़ें ख़ास जावास्क्रिप्ट ऑब्जेक्ट में लपेटी जाती हैं। जावास्क्रिप्ट कोड से पहुँचा गया Java array एक JavaArray ऑब्जेक्ट बन जाता है। इसके तत्व index से पढ़े जाते हैं और length प्रॉपर्टी भी मिलती है, बिलकुल सामान्य array की तरह। JavaClass किसी Java class को, JavaObject एक Java ऑब्जेक्ट को और JavaPackage पूरे package को दर्शाता है। इसलिए लपेटा हुआ Java array JavaArray है।
In LiveConnect, Java items used inside JavaScript are wrapped in special JavaScript objects. A Java array reached from JavaScript code becomes a JavaArray object. You can read its elements by index and check its length property, just like a normal array. JavaClass refers to a Java class, JavaObject refers to a single Java object, and JavaPackage refers to a whole Java package. So the wrapped Java array is JavaArray.
प्रश्न 8उत्तर + हल
जब कोई जावास्क्रिप्ट ऑब्जेक्ट Java को भेजा जाता है, तो runtime engine _____ प्रकार का Java wrapper बनाता है।
When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type _____.
  1. AScriptObject
  2. BJSObject
  3. CJavaObject
  4. DJobject

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

हल / Solution
यह LiveConnect की बात है, जिससे जावास्क्रिप्ट और Java आपस में काम कर पाते हैं। जब कोई जावास्क्रिप्ट ऑब्जेक्ट Java कोड को दिया जाता है, तो runtime engine उसे netscape.javascript package के JSObject प्रकार में लपेट देता है। फिर Java इसी wrapper के सहारे उसकी प्रॉपर्टी पढ़ता है और method चलाता है। ScriptObject और Jobject, LiveConnect के प्रकार नहीं हैं। JavaObject उलटी हालत है, यानी Java ऑब्जेक्ट जिसे जावास्क्रिप्ट में इस्तेमाल के लिए लपेटा गया हो।
This comes from LiveConnect, which lets JavaScript and Java work together. When a JavaScript object is passed to Java code, the runtime engine wraps it in an object of type JSObject from the netscape.javascript package. Java can then read its properties and call its methods through this wrapper. ScriptObject and Jobject are not LiveConnect types. JavaObject is the opposite case: a Java object wrapped for use inside JavaScript.
प्रश्न 9उत्तर + हल
________ विंडो ऑब्जेक्ट की tainted (दूषित) प्रॉपर्टी है।
______ is the tainted property of a window object.
  1. APathname
  2. BProtocol
  3. CDefaultstatus
  4. DHost

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

हल / Solution
Data tainting पुराने Netscape Navigator 3 की एक सुरक्षा व्यवस्था थी। कुछ प्रॉपर्टी को tainted (दूषित) माना जाता था, ताकि किसी दूसरे सर्वर की script उन्हें पढ़कर डेटा बाहर न भेज सके। window ऑब्जेक्ट की tainted प्रॉपर्टी defaultStatus और status थीं। pathname, protocol और host भी tainted थीं, पर वे location ऑब्जेक्ट की प्रॉपर्टी हैं, window की नहीं। इसलिए सही उत्तर defaultStatus है।
Data tainting was a security feature of Netscape Navigator 3. Some properties were marked as tainted, so that a script from another server could not read them and send the data away. For the window object, the tainted properties were defaultStatus and status. Pathname, protocol and host were also tainted, but they belong to the location object, not the window object. So defaultStatus is the correct answer here.
प्रश्न 10उत्तर + हल
सभी Click इवेंट कैप्चर करने के लिए विंडो को तैयार करने हेतु हम निम्नलिखित में से किस स्टेटमेंट का उपयोग करते हैं?
To set up the window to capture all Click events, which of the following statements do we use?
  1. Aप्रश्न का चित्र
  2. Bप्रश्न का चित्र
  3. Cप्रश्न का चित्र
  4. Dप्रश्न का चित्र

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

हल / Solution
पुराने Netscape इवेंट मॉडल में window ऑब्जेक्ट के पास captureEvents() method था। window.captureEvents(Event.CLICK); लिखने पर विंडो पेज के हर Click इवेंट को, लक्ष्य तत्व तक पहुँचने से पहले ही पकड़ लेती है। फिर window.onclick जैसा handler उसे सँभाल सकता है। बाक़ी तीनों स्टेटमेंट इवेंट कैप्चर शुरू नहीं करते। आज के कोड में इसकी जगह capture विकल्प के साथ addEventListener लगाया जाता है, captureEvents बस पुराना method बनकर रह गया है।
In the old Netscape event model, the window object had a captureEvents() method. The statement window.captureEvents(Event.CLICK); tells the window to catch every Click event on the page before it reaches the target element. A handler such as window.onclick can then deal with it. The other three statements do not start event capturing. Modern code uses addEventListener with the capture option; captureEvents survives only as a legacy method.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 13उत्तर app में
जावास्क्रिप्ट ऐरे लिखने का सही तरीक़ा कौन सा है?
Which is the correct way to write a JavaScript array?
  1. Avar txt = new Array(1:"tim", 2:"kim", 3: "jim")
  2. Bvar txt = new Array:1=("tim")2=("kim")3=("jim")
  3. Cvar txt = new Array("tim", "kim","jim")
  4. Dvar txt = new Array="tim","kim","jim"
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
निम्नलिखित में से कौन सी navigator ऑब्जेक्ट प्रॉपर्टी Netscape और Internet Explorer दोनों में समान रहती थी?
Which of the following navigator object properties is the same in both Netscape and IE?
  1. Anavigator.appCodeName
  2. Bnavigator.appName
  3. Cnavigator.appVersion
  4. DNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
जावास्क्रिप्ट, Date ऑब्जेक्ट में दिनांक किस रूप में संग्रहीत करता है?
How does JavaScript store dates in a date object?
  1. AThe number of milliseconds since January 1st, 1970
  2. BThe number of days since January 1st, 1900
  3. CThe number of seconds since Netscape's public stock offering
  4. DNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
जावास्क्रिप्ट में ऑब्जेक्ट लिखने के लिए किस ब्रैकेट का उपयोग किया जाता है?
Which bracket is used to write an object in JavaScript?
  1. Aगोल ब्रैकेट (Curve bracket)Curve bracket
  2. Bवर्गाकार ब्रैकेट (Square bracket)Square bracket
  3. Cकर्ली ब्रैकेट (Curly bracket)Curly bracket
  4. Dकोणीय ब्रैकेट (Corner bracket)Corner bracket
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Object and Array के सभी 61 प्रश्न — उत्तर, हल और अभ्यास

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

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

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

Web Technology के दूसरे topics

सभी topics