Skip to content
Study_Material_logo

Study Material

Study Notes, Study Guides, Articles, MCQS

Primary Menu
  • HOME
  • Education
    • Mcqs
    • Essays
    • Applications
    • Dialogues
    • Past Papers
    • Notes
    • Career Counseling
  • Articles
    • Insurance
      • Health Insurance
    • AI Tools & Automation
    • Finance & Money
    • Online Earning
    • Information Technology Articles
    • Education Articles
    • Jobs Articles
    • Media & Advertising Articles
    • Business Articles
    • Health Articles
  • Teach
    • Healthy Heart
    • Power of Mind
    • New Essays
  • More
    • Questions & Answers
    • Tips
    • Informal Letters
    • Personal Letters
    • Stories
  • Online Earning Methods
  • Blog
  • Mcqs

100 JavaScript Basics MCQs with Answers

admin February 11, 2026
100 JavaScript Basics MCQs with Answers

100 JavaScript Basics MCQs with Answers | Beginner to Intermediate JS Quiz. Explore 100 JavaScript Basics MCQs with answers designed for beginners and intermediate learners. Improve your JS skills with multiple choice questions covering variables, functions, loops, DOM, arrays, events, and more. Perfect for exams, interviews, and practice tests.

If you are preparing for exams, interviews, or simply want to strengthen your web development skills, this collection of 100 JavaScript Basics MCQs with answers is the perfect practice resource. Covering essential topics such as variables, data types, operators, functions, loops, arrays, DOM manipulation, events, and ES6 features, these multiple choice questions are designed for beginners and intermediate learners alike. Each question helps you test your understanding of core JavaScript concepts while improving your problem-solving and coding confidence. Whether you are a student, aspiring developer, or preparing for a certification test, this comprehensive JavaScript quiz will help you master the fundamentals effectively.

JavaScript Basics MCQs

1. What is JavaScript mainly used for?
A. Database management
B. Styling web pages
C. Adding interactivity to web pages
D. Designing web layouts
Answer: C


2. Which company developed JavaScript?
A. Microsoft
B. Netscape
C. Google
D. Oracle
Answer: B


3. Inside which HTML tag is JavaScript written?
A. <js>
B. <script>
C. <javascript>
D. <code>
Answer: B


4. How do you write “Hello World” in an alert box?
A. alertBox(“Hello World”);
B. msg(“Hello World”);
C. alert(“Hello World”);
D. msgBox(“Hello World”);
Answer: C


5. How do you create a variable in JavaScript?
A. var myVar;
B. variable myVar;
C. v myVar;
D. create myVar;
Answer: A


6. Which keyword is used to declare a constant in JavaScript?
A. var
B. let
C. const
D. constant
Answer: C


7. Which symbol is used for single-line comments?
A. <!– –>
B. //
C. ##
D. **
Answer: B


8. Which symbol is used for multi-line comments?
A. /* */
B. //
C. ##
D. <!– –>
Answer: A


9. Which method writes content to the browser console?
A. console.write()
B. console.log()
C. print.console()
D. write.console()
Answer: B


10. JavaScript is a ______ language.
A. Compiled
B. Markup
C. Programming
D. Styling
Answer: C


11. Which keyword allows variables to be re-declared?
A. let
B. const
C. var
D. static
Answer: C


12. Which operator is used to assign value?
A. ==
B. ===
C. =
D. !=
Answer: C


13. Which data type is NOT primitive?
A. String
B. Number
C. Object
D. Boolean
Answer: C


14. What is the correct way to write a JavaScript array?
A. var arr = (1,2,3)
B. var arr = [1,2,3]
C. var arr = {1,2,3}
D. var arr = <1,2,3>
Answer: B


15. Which method converts JSON to JavaScript object?
A. JSON.convert()
B. JSON.parse()
C. JSON.stringify()
D. JSON.object()
Answer: B


16. Which event occurs when a user clicks an HTML element?
A. onmouseclick
B. onchange
C. onclick
D. onmouseover
Answer: C


17. Which keyword defines a function?
A. func
B. function
C. define
D. method
Answer: B


18. How do you call a function named myFunc?
A. call myFunc()
B. myFunc()
C. call.function myFunc
D. execute myFunc
Answer: B


19. Which operator checks equality without type conversion?
A. ==
B. ===
C. =
D. !=
Answer: B


20. Which keyword is used to declare block-scoped variable?
A. var
B. let
C. define
D. global
Answer: B


21. JavaScript is case-sensitive.
A. True
B. False
Answer: A


22. What will typeof “Hello” return?
A. string
B. text
C. char
D. number
Answer: A


23. What will typeof 10 return?
A. int
B. number
C. digit
D. float
Answer: B


24. Which statement is used for decision making?
A. if
B. for
C. loop
D. return
Answer: A


25. Which loop executes at least once?
A. for loop
B. while loop
C. do…while loop
D. foreach loop
Answer: C


26. Which loop is best when number of iterations is known?
A. while
B. do…while
C. for
D. if
Answer: C


27. What does NaN stand for?
A. No assigned Number
B. Not a Number
C. Negative and Null
D. New and Null
Answer: B


28. Which keyword stops loop execution?
A. exit
B. break
C. stop
D. return
Answer: B


29. Which keyword skips current iteration?
A. pass
B. skip
C. continue
D. break
Answer: C


30. Which method joins array elements into string?
A. concat()
B. join()
C. combine()
D. attach()
Answer: B


31. Which method adds element to end of array?
A. push()
B. pop()
C. shift()
D. add()
Answer: A


32. Which method removes last array element?
A. push()
B. shift()
C. pop()
D. remove()
Answer: C


33. Which method removes first array element?
A. pop()
B. shift()
C. remove()
D. splice()
Answer: B


34. Which method adds element at beginning of array?
A. unshift()
B. push()
C. shift()
D. add()
Answer: A


35. Which method converts object into JSON string?
A. JSON.parse()
B. JSON.stringify()
C. JSON.convert()
D. JSON.object()
Answer: B


36. What is DOM?
A. Document Object Model
B. Data Object Method
C. Display Object Model
D. Document Order Method
Answer: A


37. Which method selects element by ID?
A. getElementById()
B. queryID()
C. selectById()
D. getID()
Answer: A


38. Which method selects elements by class name?
A. getElementsByClassName()
B. getClass()
C. queryClass()
D. findClass()
Answer: A


39. Which method selects first matching CSS selector?
A. querySelector()
B. getSelector()
C. findSelector()
D. matchSelector()
Answer: A


40. JavaScript runs on which side?
A. Server only
B. Client only
C. Both client and server
D. Database
Answer: C


41. Which symbol is used for logical AND?
A. &&
B. ||
C. &
D. AND
Answer: A


42. Which symbol is used for logical OR?
A. ||
B. &&
C. OR
D. |
Answer: A


43. Which symbol is used for NOT operator?
A. !
B. ~
C. NOT
D. ^
Answer: A


44. Which method displays output in HTML page?
A. document.write()
B. console.log()
C. print()
D. write.html()
Answer: A


45. Which function converts string to integer?
A. parseInt()
B. parseFloat()
C. NumberInt()
D. toInt()
Answer: A


46. Which function converts string to float?
A. parseInt()
B. parseFloat()
C. toFloat()
D. NumberFloat()
Answer: B


47. Which operator is used for addition?
A. +
B. *
C. %
D. /
Answer: A


48. Which operator gives remainder?
A. /
B. %
C. *
D. +
Answer: B


49. Which keyword is used to return value from function?
A. break
B. return
C. stop
D. exit
Answer: B


50. Which function delays execution?
A. delay()
B. setTimeout()
C. pause()
D. hold()
Answer: B


Microsoft Word MCQs with Answers | 100 Multiple Choice Questions


51. Which function repeats execution?
A. setInterval()
B. repeat()
C. loop()
D. cycle()
Answer: A


52. Which symbol defines object in JavaScript?
A. []
B. {}
C. ()
D. <>
Answer: B


53. Which keyword refers to current object?
A. this
B. self
C. object
D. current
Answer: A


54. Which statement handles errors?
A. try…catch
B. if…else
C. for…loop
D. switch
Answer: A


55. Which keyword throws error manually?
A. error
B. throw
C. catch
D. stop
Answer: B


56. Which keyword defines class in JavaScript?
A. object
B. class
C. define
D. struct
Answer: B


57. Which method removes spaces from both sides of string?
A. trim()
B. strip()
C. clean()
D. removeSpace()
Answer: A


58. Which method converts string to uppercase?
A. toUpperCase()
B. upper()
C. capitalize()
D. convertUpper()
Answer: A


59. Which method converts string to lowercase?
A. toLowerCase()
B. lower()
C. small()
D. convertLower()
Answer: A


60. Which keyword imports module?
A. include
B. import
C. require
D. add
Answer: B


61. Which keyword exports module?
A. export
B. send
C. share
D. provide
Answer: A


62. Which symbol defines arrow function?
A. =>
B. ->
C. ==
D. ::
Answer: A


63. Which method checks array length?
A. size()
B. length
C. count()
D. total()
Answer: B


64. Which operator increases value by 1?
A. ++
B. —
C. +=
D. =+
Answer: A


65. Which operator decreases value by 1?
A. ++
B. —
C. -=
D. =-
Answer: B


66. Which method finds element in array?
A. find()
B. search()
C. locate()
D. detect()
Answer: A


67. Which method filters array elements?
A. filter()
B. find()
C. map()
D. reduce()
Answer: A


68. Which method transforms array elements?
A. map()
B. filter()
C. reduce()
D. find()
Answer: A


69. Which method reduces array to single value?
A. map()
B. reduce()
C. filter()
D. join()
Answer: B


70. Which operator compares value and type?
A. ==
B. ===
C. !=
D. <=
Answer: B


71. Which operator compares only value?
A. ==
B. ===
C. !==
D. >=
Answer: A


72. Which method converts number to string?
A. toString()
B. string()
C. convertString()
D. parseString()
Answer: A


73. Which function checks if value is NaN?
A. isNaN()
B. checkNaN()
C. NaNcheck()
D. isNumber()
Answer: A


74. Which keyword is used to create promise?
A. new Promise
B. promise()
C. createPromise()
D. Promise.new
Answer: A


75. Which keyword handles promise success?
A. then()
B. catch()
C. resolve()
D. done()
Answer: A


76. Which keyword handles promise error?
A. error()
B. catch()
C. fail()
D. reject()
Answer: B


77. Which keyword is used for asynchronous functions?
A. async
B. wait
C. sync
D. awaitOnly
Answer: A


78. Which keyword waits for async result?
A. wait
B. async
C. await
D. pause
Answer: C


79. Which object represents browser window?
A. document
B. window
C. screen
D. navigator
Answer: B


80. Which object represents webpage?
A. window
B. document
C. navigator
D. browser
Answer: B


81. Which method reloads page?
A. reloadPage()
B. location.reload()
C. refresh()
D. window.refresh()
Answer: B


82. Which method redirects page?
A. location.href
B. window.redirect
C. page.move
D. goto()
Answer: A


83. Which event occurs when page loads?
A. onload
B. onclick
C. onchange
D. onhover
Answer: A


84. Which event occurs when mouse moves over element?
A. onmouseover
B. onclick
C. onchange
D. onfocus
Answer: A


85. Which event occurs when input loses focus?
A. onblur
B. onfocus
C. onchange
D. onclick
Answer: A


86. Which keyword deletes object property?
A. remove
B. delete
C. clear
D. erase
Answer: B


87. Which method checks string contains text?
A. includes()
B. contains()
C. match()
D. searchText()
Answer: A


88. Which method extracts part of string?
A. slice()
B. cut()
C. split()
D. divide()
Answer: A


89. Which method splits string into array?
A. slice()
B. split()
C. join()
D. divide()
Answer: B


90. Which method merges arrays?
A. join()
B. concat()
C. merge()
D. attach()
Answer: B


91. Which method sorts array?
A. arrange()
B. order()
C. sort()
D. organize()
Answer: C


92. Which method reverses array?
A. reverse()
B. invert()
C. back()
D. flip()
Answer: A


93. Which operator checks inequality?
A. !=
B. ==
C. ===
D. <=
Answer: A


94. Which method returns current date?
A. Date.now()
B. getDate()
C. currentDate()
D. today()
Answer: A


95. Which object handles math operations?
A. Number
B. Math
C. Calc
D. Arithmetic
Answer: B


96. Which method returns random number?
A. Math.random()
B. Number.random()
C. random()
D. getRandom()
Answer: A


97. Which keyword ends switch case?
A. stop
B. exit
C. break
D. return
Answer: C


98. Which statement selects multiple conditions?
A. if
B. switch
C. loop
D. for
Answer: B


99. JavaScript files have which extension?
A. .java
B. .js
C. .script
D. .jv
Answer: B


100. JavaScript can run without browser using?
A. Node.js
B. React
C. Angular
D. Bootstrap
Answer: A


Advertisement:

school-management-software

Tags: front-end development quiz JavaScript assessment test JavaScript Basics MCQs JavaScript beginner questions JavaScript certification questions JavaScript coding MCQs JavaScript exam preparation JavaScript fundamentals quiz JavaScript learning material JavaScript multiple choice questions JavaScript objective questions JavaScript online test JavaScript practice questions JavaScript programming basics JavaScript quiz with answers JavaScript test paper JS interview questions JS programming MCQs JS theory questions web development MCQs

Post navigation

Previous: AI Automation Explained: How Machines Perform Human Tasks Faster and Smarter
Next: 100 HTML & CSS MCQs with Answers (Beginner to Advanced)

Related Stories

100 Business Studies MCQs with Answers
  • Mcqs

100 Business Studies MCQs with Answers | Exam Prep Questions for Students

admin March 2, 2026
100 SQL Queries MCQs with Answers (Beginner to Advanced)
  • Mcqs

100 SQL Queries MCQs with Answers (Beginner to Advanced)

admin March 2, 2026
100 Database Management MCQs with Answers
  • Mcqs

100 Database Management MCQs with Answers

admin February 27, 2026
  • 10 Common Money Myths That Are Holding You Back from Financial Freedom
    10 Common Money Myths That Are Holding You Back from Financial Freedom
  • 100 Business Studies MCQs with Answers
    100 Business Studies MCQs with Answers | Exam Prep Questions for Students
  • 100 SQL Queries MCQs with Answers (Beginner to Advanced)
    100 SQL Queries MCQs with Answers (Beginner to Advanced)
  • 100 Database Management MCQs with Answers
    100 Database Management MCQs with Answers
  • 100 Operating Systems MCQs with Answers
    100 Operating Systems MCQs with Answers
  • 10 Common Money Myths That Are Holding You Back from Financial Freedom
    10 Common Money Myths That Are Holding You Back from Financial Freedom
  • 10 Proven Strategies to Grow Your Business in 2025
    10 Proven Strategies to Grow Your Business in 2025
  • 10 Smart Money Habits That Will Make You Wealthy Over Time
    10 Smart Money Habits That Will Make You Wealthy Over Time
  • 10 Smart Ways to Manage Your Child’s Summer Vacation Effectively
    10 Smart Ways to Manage Your Child’s Summer Vacation Effectively
  • 100 Advanced English Grammar MCQs with Answers
    100 Advanced English Grammar MCQs with Answers
Work from home jobs

Categories

  • Technology should participate in Co-curricularTechnology should participate in Co-curricular
  • Three recommendations for college kidsThree recommendations for college kids
  • How can I start a business with money online?How can I start a business with money online?
  • Alert! Social websites can be harmfulAlert! Social websites can be harmful
  • Asked questions in an interviewAsked questions in an interview

  • 5 Powerful Books That Can Transform Your Mindset About Life and Love5 Powerful Books That Can Transform Your Mindset About Life and Love
  • Best Modern Tools of Online EducationBest Modern Tools of Online Education
  • Brilliant small Business Ideas for college students to Make Extra MoneyBrilliant small Business Ideas for college students to Make Extra Money
  • Six Strategies for students to Deal With Exam FailureSix Strategies for students to Deal With Exam Failure
  • Three recommendations for college kidsThree recommendations for college kids

Archives

  • Home
  • Essays
  • Articles
  • Stories
  • Applications
  • Personal Letters
  • Informal Letters
  • Dialogues

You may have missed

10 Common Money Myths That Are Holding You Back from Financial Freedom
  • Finance & Money

10 Common Money Myths That Are Holding You Back from Financial Freedom

admin March 3, 2026
100 Business Studies MCQs with Answers
  • Mcqs

100 Business Studies MCQs with Answers | Exam Prep Questions for Students

admin March 2, 2026
100 SQL Queries MCQs with Answers (Beginner to Advanced)
  • Mcqs

100 SQL Queries MCQs with Answers (Beginner to Advanced)

admin March 2, 2026
100 Database Management MCQs with Answers
  • Mcqs

100 Database Management MCQs with Answers

admin February 27, 2026

Articles

  • Business Articles
  • Education Articles
  • Health Articles
  • Information Technology Articles
  • Jobs Articles
  • Media & Advertising Articles
  • Career Counseling
  • Insurance
  • Online Earning

Questions & Answers

  • Medical
  • History
  • Women’s Health
  • Weight Loss & Obesity
  • Stress Management
  • Pain Management
  • Oral Health
  • Multiple Sclerosis

MCQS

  • English
  • Biology
  • Physics
  • Mathematics
  • Urdu
  • Islamiat
  • Pak Studies
  • Computer
Copyright © All rights reserved. | MoreNews by AF themes.