SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
IMPORTANT MCQs
FOR ONLINE EXAM
JAVASCRIPT
1) In a Javascript Application what function can be used to send
messages to users requesting for an text input?
a. Display()
b. Alert()
c. GetOutput()
d. Prompt()
ANSWER: Prompt()
Explanation:
This function is used when we want to input text in javascript.
2) - Which of the following function of String object returns a string
representing the specified object?
A - toLocaleUpperCase()
B - toUpperCase()
C - toString()
D - substring()
Answer : C
Explanation
toString() − Returns a string representing the specified object.
3) - Which built-in method returns the characters in a string beginning at the
specified location?
A - substr()
B - getSubstring()
C - slice()
D - None of the above.
Answer : A
Explanation
substr() method returns the characters in a string beginning at the specified
location through the specified number of characters.
4) - Which of the following function of String object returns the characters
in a string between two indexes into the string?
A - slice()
B - split()
C - substr()
D - substring()
Answer : D
Explanation
substring() − Returns the characters in a string between two indexes into the
string.
5)The script tag must be placed in
A.head
B.head and body
C.title and head
D.all of the mentioned
Answer: Option B
Solution:If the script tag is placed after the body tag, then, it will not be
evaluated at all.
Also, it is always recommended and effective to use the script snippet in the
<head> tag.
6)Which of the following attribute is used to include External JS code inside
your HTML document
A.src
B.ext
C.script
D.link
Answer: Option A
Solution:
A ”src” attribute could be used to add any external code into the HTML
document.
7)The setTimeout() belongs to which object?
A.Element
B.Window
C.Location
D.None of the mentioned
Answer: Option B
Solution:
The setTimeout() method of the Window object
schedules a function to run after a specified number of milliseconds elapses.
8. To which object does the location property belong?
A.Window
B.Position
C.Element
D.Location
Answer: Option A
Solution:
The location property of the Window object refers to a Location object,
which represents the current URL of the document displayed in the window,
and which also defines methods for making the window load a new
document.
9) The keyword or the property that you use to refer to an object through
which they were invoked is
A.from
B.to
C.this
D.Object
Answer: Option C
Solution:
The ‘this’ keyword is used to refer to the object through which the properties or
methods were invoked. This use of ‘this’ is a fundamental characteristic of the
methods of any class
10)The four kinds of class members are
A.Instance methods, Instance fields, Static method, Dynamic method
B.Instance fields, Instance methods, Class fields, Class methods
C.Instance fields, Non-instance fields, Dynamic methods, Global methods
D.Global methods, Local methods, Dynamic methods, Static methods
Answer: Option B
Solution:
The four kinds of class members are Instance fields, Instance methods, Class fields,
Class methods.
Like share and
subscribe
KEEP WATCHING…

More Related Content

PDF
Power Point MCQ Questions and Answers (MS PowerPoint)
PDF
COPA Operating System Most Important Questions
PDF
Top 40 Javascript Interview Questions and Answers.pdf
PDF
Java Multiple Choice Questions and Answers
DOC
XLS
Lt web quiz_answer
PDF
CSS-three years solved model paper msbte
PDF
CSS-three years solved model paper msbte
Power Point MCQ Questions and Answers (MS PowerPoint)
COPA Operating System Most Important Questions
Top 40 Javascript Interview Questions and Answers.pdf
Java Multiple Choice Questions and Answers
Lt web quiz_answer
CSS-three years solved model paper msbte
CSS-three years solved model paper msbte

Similar to Javascript MCQ (20)

DOCX
Top Javascript Q's
PDF
JavaScript(Es5) Interview Questions & Answers
PDF
JavaScript MCQ (JS Coding Questions and Answers)
PDF
HTML and JavaScript BASICS 4th Edition Barksdale Test Bank
PDF
98-375-Questions.pdf
DOCX
ISMG 2800 123456789
PPTX
Mcq Of Java Script ppt for Teaching and self preparation
PPTX
Java script
PDF
The JavaScript You Wished You Knew
PDF
JavaScript Interview Questions with Answers
PPTX
BITM3730Week6.pptx
TXT
PDF
656981533-100-JavaScript-Interview-QnA.pdf
PDF
Lecture7
PDF
JavaScript
PDF
JavaScript Array Interview Questions PDF By ScholarHat
PPTX
BITM3730 10-4.pptx
PDF
web dev diploma
PPTX
BITM3730 10-3.pptx
PDF
05 JavaScript #burningkeyboards
Top Javascript Q's
JavaScript(Es5) Interview Questions & Answers
JavaScript MCQ (JS Coding Questions and Answers)
HTML and JavaScript BASICS 4th Edition Barksdale Test Bank
98-375-Questions.pdf
ISMG 2800 123456789
Mcq Of Java Script ppt for Teaching and self preparation
Java script
The JavaScript You Wished You Knew
JavaScript Interview Questions with Answers
BITM3730Week6.pptx
656981533-100-JavaScript-Interview-QnA.pdf
Lecture7
JavaScript
JavaScript Array Interview Questions PDF By ScholarHat
BITM3730 10-4.pptx
web dev diploma
BITM3730 10-3.pptx
05 JavaScript #burningkeyboards
Ad

More from Shaheen Shaikh (10)

PDF
Internet of things (IOT)
PPTX
IOT MCQ part3- Internet of Things
PPTX
PHP Session - Mcq ppt
PPTX
Mcq ppt Php- array
PPTX
PPTX
Css ppt - Cascading Style Sheets
PPTX
Introduction to web technologies
PPTX
Fuzzy System and fuzzy logic -MCQ
PPTX
Mcq for Online Exam Soft Computing
PPTX
Genetic Algorithm
Internet of things (IOT)
IOT MCQ part3- Internet of Things
PHP Session - Mcq ppt
Mcq ppt Php- array
Css ppt - Cascading Style Sheets
Introduction to web technologies
Fuzzy System and fuzzy logic -MCQ
Mcq for Online Exam Soft Computing
Genetic Algorithm
Ad

Recently uploaded (20)

PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
01-Introduction-to-Information-Management.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Cell Types and Its function , kingdom of life
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Complications of Minimal Access Surgery at WLH
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPH.pptx obstetrics and gynecology in nursing
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
RMMM.pdf make it easy to upload and study
01-Introduction-to-Information-Management.pdf
VCE English Exam - Section C Student Revision Booklet
TR - Agricultural Crops Production NC III.pdf
Anesthesia in Laparoscopic Surgery in India
GDM (1) (1).pptx small presentation for students
human mycosis Human fungal infections are called human mycosis..pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Sports Quiz easy sports quiz sports quiz
Basic Mud Logging Guide for educational purpose
Cell Types and Its function , kingdom of life
O5-L3 Freight Transport Ops (International) V1.pdf
Complications of Minimal Access Surgery at WLH
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...

Javascript MCQ

  • 1. IMPORTANT MCQs FOR ONLINE EXAM JAVASCRIPT
  • 2. 1) In a Javascript Application what function can be used to send messages to users requesting for an text input? a. Display() b. Alert() c. GetOutput() d. Prompt() ANSWER: Prompt() Explanation: This function is used when we want to input text in javascript. 2) - Which of the following function of String object returns a string representing the specified object? A - toLocaleUpperCase() B - toUpperCase() C - toString() D - substring() Answer : C Explanation toString() − Returns a string representing the specified object.
  • 3. 3) - Which built-in method returns the characters in a string beginning at the specified location? A - substr() B - getSubstring() C - slice() D - None of the above. Answer : A Explanation substr() method returns the characters in a string beginning at the specified location through the specified number of characters. 4) - Which of the following function of String object returns the characters in a string between two indexes into the string? A - slice() B - split() C - substr() D - substring() Answer : D Explanation substring() − Returns the characters in a string between two indexes into the string.
  • 4. 5)The script tag must be placed in A.head B.head and body C.title and head D.all of the mentioned Answer: Option B Solution:If the script tag is placed after the body tag, then, it will not be evaluated at all. Also, it is always recommended and effective to use the script snippet in the <head> tag. 6)Which of the following attribute is used to include External JS code inside your HTML document A.src B.ext C.script D.link Answer: Option A Solution: A ”src” attribute could be used to add any external code into the HTML document.
  • 5. 7)The setTimeout() belongs to which object? A.Element B.Window C.Location D.None of the mentioned Answer: Option B Solution: The setTimeout() method of the Window object schedules a function to run after a specified number of milliseconds elapses. 8. To which object does the location property belong? A.Window B.Position C.Element D.Location Answer: Option A Solution: The location property of the Window object refers to a Location object, which represents the current URL of the document displayed in the window, and which also defines methods for making the window load a new document.
  • 6. 9) The keyword or the property that you use to refer to an object through which they were invoked is A.from B.to C.this D.Object Answer: Option C Solution: The ‘this’ keyword is used to refer to the object through which the properties or methods were invoked. This use of ‘this’ is a fundamental characteristic of the methods of any class 10)The four kinds of class members are A.Instance methods, Instance fields, Static method, Dynamic method B.Instance fields, Instance methods, Class fields, Class methods C.Instance fields, Non-instance fields, Dynamic methods, Global methods D.Global methods, Local methods, Dynamic methods, Static methods Answer: Option B Solution: The four kinds of class members are Instance fields, Instance methods, Class fields, Class methods.