MCQs on Javascript

Ques 1

SPSC I.T.I Instructor

जावास्क्रिप्ट भाषा है:

JavaScript language is:

[A] Low level

[B] Object oriented

[C] Structure oriented

[D] Procedure oriented

Correct Answer : Object oriented


Ques 2

SPSC I.T.I Instructor

जावास्क्रिप्ट में प्रयुक्त स्कोपिंग का प्रकार है:

The type of scoping used in JavaScript is:

[A] Sequential

[B] Lexical

[C] Parallel

[D] Literal

Correct Answer : Lexical


Ques 3

SPSC I.T.I Instructor

उसे पहचानें जो जावास्क्रिप्ट में त्रुटि नहीं है-

Identify the one which is not an error in JavaScript-

[A] Division by zero

[B] Missing of bracket

[C] Syntax error

[D] Missing of semicolons

Correct Answer : Division by zero


Ques 4

UPP Programmer 2013

जावास्क्रिप्ट में निम्नलिखित लूपिंग संरचनाएँ क्या उपलब्ध हैं?

What are the following looping structures are available in javascripts ?

[A] foreach,while loop

[B] for, while loop

[C] for, foreach

[D] do-while loop, foreach

Correct Answer : for, while loop


Ques 5

MPESB Police Constable 2023

एक चर एक पहचानकर्ता है जो मानों को संग्रहीत कर सकता है। कीवर्ड ____ का उपयोग एक चर घोषित करने के लिए किया जाता है।

A variable is an identifier that can store values. Keyword ____ is used to declare a variable.

[A] dec

[B] var

[C] str

[D] vra

Correct Answer : var


Ques 6

HP-JOA-IT 2021

निम्नलिखित में से कौन सी भाषा HTML दस्तावेज़ों में स्क्रिप्टिंग भाषा के रूप में प्रयोग की जाती है?

Which of the following language is used as scripting language in HTML documents?

[A] JavaScript

[B] Java

[C] ForTan

[D] Python

Correct Answer : JavaScript


Ques 7

Chhattisgarh ITI 2023

किसी संख्या को दशमलव स्थानों की विशिष्ट संख्या के साथ प्रारूपित करने के लिए किस अंतर्निहित जावास्क्रिप्ट फ़ंक्शन का उपयोग किया जाता है?

Which built-in JavaScript function is used to format a number with a specific number of decimal places?

[A] toFixed()

[B] format()

[C] setDecimal()

[D] round()

Correct Answer : toFixed()


Ques 8

Chhattisgarh ITI 2023

जावास्क्रिप्ट में किसी मौजूदा ऑब्जेक्ट में प्रॉपर्टी जोड़ने के लिए किस विधि का उपयोग किया जाता है?

Which method is used to add a property to an existing object in JavaScript?

[A] object.defineProperty()

[B] object.create()

[C] object.assign()

[D] object.add()

Correct Answer : object.assign()


Ques 9

UPPCL-TG2-2021

1995 में जावास्क्रिप्ट का निर्माण किया गया और इसे शुरू में ______ के नाम से जाना जाता था।

In 1995, JavaScript was created and was initially known as ______.

[A] Python

[B] Ruby

[C] Go

[D] LiveScript

Correct Answer : LiveScript


Ques 10

o level July -2022

निम्नलिखित में से किस प्रकार का चर केवल उस फ़ंक्शन के भीतर दिखाई देता है जहाँ उसे परिभाषित किया गया है?

Which of the following types of variable is visible only within a function where it is defined?

[A] Global variable

[B] Local variable

[C] Both A and B

[D] None of these

Correct Answer : Local variable


Ques 11

o level July -2022

जावास्क्रिप्ट में alert() फ़ंक्शन का उपयोग निम्न के लिए किया जाता है:

The alert() function in JavaScript is used for:

[A] To display a virtual alert box

[B] To display output on console

[C] To evaluate the expression

[D] Both A and C

Correct Answer : Both A and C


Ques 12

o level July -2022

जावास्क्रिप्ट में Confirm() विधि किस विधि से संबंधित है?

Confirm() method in JavaScript belongs to which method?

[A] Document

[B] Windows

[C] Frame

[D] Method

Correct Answer : Windows


Ques 13

o level July -2022

निम्नलिखित में से किस तरीके से आप जावास्क्रिप्ट में SCRIPT टैग डाल सकते हैं?

In which of the following way you can insert a SCRIPT tag in JavaScript?

[A] Between two BODY tags

[B] Between two HEAD tags

[C] In the HEAD section as a link to an external file

[D] All of the above

Correct Answer : All of the above


Ques 14

o level July -2022

जावास्क्रिप्ट में वेरिएबल का सही सिंटैक्स निम्नलिखित में से कौन सा है?

Which of the following is the correct syntax of variable in javascript ?

[A] 2number

[B] my phone number

[C] my_phone_number

[D] None of these

Correct Answer : my_phone_number


Ques 15

HPPSC IT SPECIALIST 2024

जावास्क्रिप्ट में, हम स्ट्रिंग .fromcharcode() का उपयोग इसलिए करते हैं क्योंकि-

In JavaScript , we use string .fromcharcode() as it is because-

[A] It is dynamic method.

[B] It is a static method

[C] It uses string () constructer

[D] It helps to determine the number of characters

Correct Answer : It is a static method


Ques 16

HPPSC IT SPECIALIST 2024

जावास्क्रिप्ट में सबसे धीमा लूप कौन सा है?

In JavaScript , which one is slowest loop?

[A] While

[B] DO

[C] For

[D] For-in

Correct Answer : For-in


Ques 17

COMPUTER OPERATOR 2022

नीचे दिए गए जावास्क्रिप्ट कोड का आउटपुट क्या है?

What is the output of the below java script code ?

<script type=“text/javascript”
language =“javascript”>
var qpt = new Array();
qpt[0] = “WebDevelopment”;
qpt[1] =“ApplicationDevelopment”
qpt[2] =“Testing”
qpt[3] = “QualityPointTechnologies”;
document.write(qpt[0, 1, 2, 3]) ;
</script>

[A] Error

[B] QualityPointTechnologies

[C] WebDevelopment

[D] Web Development, Application Development, Testing , quality point technologies

Correct Answer : Web Development, Application Development, Testing , quality point technologies


Ques 18

UP POLICE -2022

एक परिदृश्य में, उपयोगकर्ता आउटपुट को किसी पेज पर लिखना चाहता है। इसके लिए निम्न में से कौन सी जावास्क्रिप्ट कमांड का उपयोग किया जाना चाहिए?

In one of the scenario's, user wants to write the output to a page. Which of the following JavaScript commands should be used for the same?

[A] Jscript.write

[B] HTML.write

[C] It is not possible

[D] document.write

Correct Answer : document.write


Ques 19

UP POLICE -2022

जावास्क्रिप्ट के बारे में निम्नलिखित में से कौन सा कथन सत्य है?

Which of the following statements is true about JavaScript?

[A] JavaScript doesn't execute without preliminary compilation

[B] JavaScript is not an interpreted language

[C] JavaScript along with HTML should be compiled before executing

[D] JavaScript executes without preliminary compilation

Correct Answer : JavaScript executes without preliminary compilation


Ques 20

निम्नलिखित जावास्क्रिप्ट का आउटपुट क्या होगा

What will be the Output of following JavaScript

<script language=“Javascript”>
javascript:function x(){
x=4+“4”;
document.write(x);
} x ( ) ;
</script>

[A] 44

[B] 8

[C] 4

[D] Error output

Correct Answer : 44


Ques 21

Programmer -2013

निम्नलिखित में से कौन सा कथन नीचे दिए गए कोड के लिए सबसे उपयुक्त है?

Which of the following statements is most appropriate for the code given below ?

int tryThis (char s [ ] ) {
int c1 = 0, c2 = 0, i = 0;
for (i = 0 ; s [ i ] ; i ++)
if (i % 2 = = 0)
c1 ++ ;
else
c2 ++ ;
 return c1 – c2;
}
main ( ) {
if (!tryThis (“Palindromes”))
printf (“even”);
else
printf(“odd”);
}

[A] The program will not compile as the condition in for loop is not given properly

[B] The program will not display anything as for loop is infinite

[C] The output of the program will be even

[D] The output of the program will be odd

Correct Answer : The output of the program will be even


Ques 22

Programmer -2013

निम्नलिखित जावास्क्रिप्ट का आउटपुट क्या होगा?

What will be the Output of following JavaScript ?

<script language=“javascript”>
javascript:function x()
{
var s= “Good100%”;
var pattern = / \D/g;
var output= s.match(pattern);
document.write(output);
}x();
</script>

[A] Good %

[B] 1,0,0

[C] G,o,o,d,%

[D] Error

Correct Answer : G,o,o,d,%


Ques 23

Programmer -2013

निम्नलिखित जावास्क्रिप्ट का आउटपुट क्या होगा?

What will be the Output of following javascript ?

<script language=“javascript”>
javascript:function x ( )
{
var qpt = “First come, first served”;
var pattern = /first/g;
document.write(qpt.match(pattern) [ 1 ]);
} x ( ) ;
</script>

[A] first

[B] First

[C] undefined

[D] None of the above

Correct Answer : first


Ques 24

Programmer -2013

जावास्क्रिप्ट में निम्नलिखित लूपिंग संरचनाएं क्या उपलब्ध हैं?

What are the following looping structures are available in JavaScript ?

[A] for, foreach

[B] foreach,while loop

[C] do-while loop, foreach

[D] for, while loop

Correct Answer : for, while loop


Ques 25

MPESB-2023

जावास्क्रिप्ट प्रोग्रामिंग में सिंगल लाइन कमेंट्स को किस रूप में अभिव्यक्त किया जाता है

In JavaScript programming what are single line comments expressed as ?

[A] //

[B] /*

[C] @

[D] ()

Correct Answer : //


Ques 26

MPESB-2023

जावास्क्रिप्ट के संबंध में निम्नलिखित में से कौन सा कथन सत्य है?

Which of the following observations about JavaScript is correct?

[A] It is Object-Based language

[B] It is Assembly language

[C] It is Object-Oriented language

[D] It is Machine-Level language

Correct Answer : It is Object-Based language


Ques 27

MPESB-2023

JavaScript में Arrays को निम्नलिखित में से किस कथन द्वारा परिभाषित किया गया है?

Arrays in JavaScript are defined by which of the following statements?

[A] It is an ordered list of values

[B] It is an ordered list of objects

[C] It is an ordered list of string

[D] It is an ordered list of functions

Correct Answer : It is an ordered list of values


Ques 28

MPESB -2023

निम्नलिखित जावास्क्रिप्ट कोड का आउटपुट क्या होगा?

What will be the output of the following JavaScript code?

var z = 15;
Z++;

[A] 17

[B] 19

[C] 16

[D] 20

Correct Answer : 16


Ques 29

MPESB -2023

जावास्क्रिप्ट कोड स्निपेट को कॉल करने के लिए निम्न में से किसका उपयोग किया जा सकता है?

Which of the following can be used to call a JavaScript Code Snippet?

[A] Function/Method

[B] Preprocessor

[C] Triggering Event

[D] RMI

Correct Answer : Function/Method


Ques 30

MPESB -2023

जावास्क्रिप्ट में फ़ंक्शन कैसे कॉल करें?

How to call a function in JavaScript?

[A] < Function name> ([parameter list])

[B] << Function name> ([Parameter list]) < function name>>

[C] <Function name> <function name> ([Parameter list])

[D] Parameter list

Correct Answer : < Function name> ([parameter list])


Ques 31

MPESB -2023

यह निर्धारित करने के लिए नीचे दी गई सूची से उपयुक्त भाग चुनें कि क्या चर "x" "NULL" के बराबर नहीं है:

Pick the appropriate portion from the list below to determine whether the variable "x" does not equal "NULL":

[A] if((x!))

[B] if(x=null!)

[C] if(null=x)

[D] if(x!==null)

Correct Answer : if(x!==null)


Ques 32

MPESB -2023

चर या स्थिरांक घोषित करने के लिए कितने JavaScript कीवर्ड की आवश्यकता है?

How many JavaScript keywords are required to declare variables or constants?

[A] 3

[B] 6

[C] 2

[D] 7

Correct Answer : 3


Ques 33

Rajasthan-Patwari-2021

जावास्क्रिप्ट में <noscript> टैग का उद्देश्य क्या है?

What is the purpose of <noscript> tag in JavaScript ?

[A] Prevents scripts on the page from executing

[B] Enclose text to be displayed by non-JavaScript browser

[C] Suppresses the result to be displayed on the web page

[D] None of these

Correct Answer : Enclose text to be displayed by non-JavaScript browser


Ques 34

Rajasthan-Patwari-2021

निम्नलिखित में से कौन सा सर्वर-साइड जावास्क्रिप्ट ऑब्जेक्ट है?

Which of the following is a server -side JavaScript object ?

[A] Function

[B] File

[C] FileUpload

[D] Date

Correct Answer : File


Ques 35

Rajasthan-Patwari-2021

निम्नलिखित में से कौन सा जावा स्क्रिप्ट ऐरे लिखने का सही तरीका है?

Which of the following is the correct way for writing Java Script array ?

[A] <script href="formValidation.js">

[B] <script source="form Validation.js">

[C] <script name="form Validation.js">

[D] <script src="formValidation.js">

Correct Answer : <script src="formValidation.js">


Ques 36

Rajasthan-Patwari-2021

जावास्क्रिप्ट के साथ किस प्रकार के छवि मानचित्र का उपयोग किया जा सकता है?

What type of image map could be used with JavaScript?

[A] Client - side image maps

[B] Server-side image maps

[C] Both a & b

[D] Local host image maps

Correct Answer : Client - side image maps


Ques 37

Rajasthan-Patwari-2021

निम्नलिखित में से कौन जावास्क्रिप्ट फ़ंक्शन सक्षम हैं?

Which of the following are capable of JavaScript functions?

[A] Returning multiple values

[B] Accepting parameters

[C] Accepting parameters and returning values

[D] All of these

Correct Answer : Accepting parameters and returning values


Ques 38

COPATT-2018

जावास्क्रिप्ट में कोड का आउटपुट क्या है:

What is output of the code in JavaScript :

isNaN(50/0)?

[A] 0

[B] 50

[C] FALSE

[D] TRUE

Correct Answer : TRUE


Ques 39

COPATT-2018

जावास्क्रिप्ट में प्रयुक्त रिलेशनल ऑपरेटर क्या है?

What is the relational operator used in JavaScript?

[A] <=

[B] ++

[C] >>

[D] &

Correct Answer : <=


Ques 40

COPATT-2018

जावास्क्रिप्ट में कोड का आउटपुट क्या है?

What is the output of the code in JavaScript ?

x=true:
Number(x);

[A] 0

[B] 1

[C] 4

[D] NaN

Correct Answer : 1


Ques 41

COPATT-2018

जावास्क्रिप्ट में कौन सी प्रणाली डेटा और विधि को एक साथ उपयोग करने के लिए बंडल करती है?

What mechanism in JavaScript bundles the data and method to use them together?

[A] Abstraction

[B] Encapsulation

[C] Inheritance

[D] Polymorphism

Correct Answer : Encapsulation


Ques 42

COPATT-2018

जावास्क्रिप्ट में किस प्रकार का लूप, यदि स्थिति सत्य है, तो जाँच से पहले हमेशा एक बार निष्पादित किया जाएगा?

Which type of loop in JavaScript , will always be executed once before checking , if the condition is true ?

[A] For Loop

[B] While Loop

[C] Do/while Loop

[D] For/ in loop

Correct Answer : Do/while Loop


Ques 43

COPATT-2018

जावास्क्रिप्ट में प्रयुक्त रिलेशनल ऑपरेटर कौन सा है?

Which is the relational operator used in JavaScript?

[A] <=

[B] ++

[C] >>

[D] &

Correct Answer : <=


Ques 44

COPATT-2018

दो स्ट्रिंग्स को जोड़ने के लिए कोड क्या है ताकि परिणाम Hello world के रूप में प्राप्त हो सके यदि

What is the code to join two strings to get the result res as Hello world if

var str1="Hello";
var str2="World"

[A] re=concat(str1,str2)

[B] var res=concat(str1 str2)

[C] rcs=str1,concat(var str2)

[D] var res=str1.concat(str2)

Correct Answer : var res=str1.concat(str2)


Ques 45

COPATT-2018

जावास्क्रिप्ट में कोड का आउटपुट क्या है:

What is output of the code in JavaScript:

isNaN(50/0)?

[A] 0

[B] 50

[C] FALSE

[D] TRUE

Correct Answer : TRUE


Ques 46

COPATT-2018

जावास्क्रिप्ट में कौन सी प्रणाली डेटा और विधि को एक साथ उपयोग करने के लिए बंडल करती है?

What mechanism in JavaScript bundles the data and method to use them together ?

[A] Abstraction

[B] Encapsulation

[C] Inheritance

[D] Polymorphism

Correct Answer : Encapsulation


Ques 47

COPATT-2018

जावास्क्रिप्ट में स्ट्रिंग का आउटपुट क्या है?

What is the output of the string in JavaScript

var x-3.759;
x.tofixed(0);

[A] 4

[B] 3

[C] 3.7

[D] 3.8

Correct Answer : 4


Ques 48

COPATT-2018

दिनांक/समय फ़ंक्शन कौन सा है?

Which is Date/Time function?

[A] Mid()

[B] Sign()

[C] ISDATE()

[D] MONTH()

Correct Answer : MONTH()


Ques 49

COPATT-2018

कोड का आउटपुट क्या है:

What is the output of the code:

Dim s As string;
s="Wholehearted"
debug.print mid (s,6,4)?

[A] Hear

[B] Heart

[C] Eart

[D] Whole

Correct Answer : Hear


Ques 50

COPATT-2018

जावास्क्रिप्ट में कौन सा ऑपरेटर OR ऑपरेशन करने के लिए प्रयोग किया जाता है?

Which operator in JavaScript is used to perform the OR operation ?

[A] &

[B] ~

[C] |

[D] ^

Correct Answer : |


Latest Updates