💻
Programming Medium

JavaScript and Web Development

Take this intermediate programming test online with 15 medium-difficulty questions on JavaScript and web development.

15 Questions
30s Per Question
0+ Plays
← All Programming Quizzes 📚 Study Guide for this category →
💡 Create account to save scores & earn XP
📋 View All 15 Questions & Answers

1. What is React primarily used for?

  • A. Building user interfaces ✓
  • B. Managing databases
  • C. Styling webpages
  • D. Writing server-side code

💡 React is a popular JavaScript library used for building interactive user interfaces.

2. What is a JavaScript function used to display an alert box called?

  • A. alert() ✓
  • B. popup()
  • C. notify()
  • D. message()

💡 The alert() function displays a popup alert box with a specified message.

3. What does 'npm' stand for?

  • A. Node Package Manager ✓
  • B. New Program Module
  • C. Network Protocol Manager
  • D. Node Program Method

💡 npm stands for Node Package Manager, used to install and manage JavaScript packages.

4. What does 'addEventListener' do in JavaScript?

  • A. Attaches an event handler to an element ✓
  • B. Deletes an element
  • C. Creates a new webpage
  • D. Styles an element

💡 'addEventListener' attaches a function that runs when a specified event occurs on an element.

5. What is the purpose of 'querySelector' in JavaScript?

  • A. To select an HTML element based on a CSS selector ✓
  • B. To create a new element
  • C. To delete an element
  • D. To style an element

💡 'querySelector' selects the first HTML element that matches a specified CSS selector.

6. What is the purpose of 'const' in JavaScript?

  • A. To declare a variable that cannot be reassigned ✓
  • B. To declare a variable that can change
  • C. To create a loop
  • D. To define a function

💡 'const' declares a variable whose reference cannot be reassigned after its initial value is set.

7. Which keyword declares a variable in modern JavaScript that can be reassigned?

  • A. var
  • B. let ✓
  • C. const
  • D. define

💡 'let' declares a block-scoped variable in modern JavaScript that can be reassigned later.

8. What does 'NaN' stand for in JavaScript?

  • A. Not a Number ✓
  • B. No Assigned Number
  • C. New Array Node
  • D. Null and Null

💡 'NaN' stands for 'Not a Number', representing an invalid or undefined numeric result.

9. What does 'async/await' help manage in JavaScript?

  • A. Asynchronous operations ✓
  • B. Loops
  • C. Variable declarations
  • D. CSS styling

💡 'async/await' provides a cleaner syntax for working with asynchronous operations in JavaScript.

10. What is a callback function?

  • A. A function passed as an argument to another function, to be executed later ✓
  • B. A function that runs immediately
  • C. A type of variable
  • D. A CSS property

💡 A callback function is passed as an argument to another function and executed at a later point.

11. What does '===' check for in JavaScript?

  • A. Strict equality (value and type) ✓
  • B. Loose equality (value only)
  • C. Assignment
  • D. Inequality

💡 '===' checks for strict equality, comparing both the value and the type of two operands.

12. What does 'localStorage' allow in JavaScript?

  • A. Storing data in the browser that persists across sessions ✓
  • B. Sending data to a server
  • C. Deleting cookies
  • D. Compiling JavaScript code

💡 'localStorage' allows web applications to store data in the browser that persists even after the browser is closed.

13. What does 'DOM manipulation' refer to?

  • A. Changing the content or structure of a webpage using JavaScript ✓
  • B. Writing CSS
  • C. Creating a database
  • D. Compiling code

💡 DOM manipulation involves using JavaScript to dynamically change a webpage's content or structure.

14. What does AJAX allow web pages to do?

  • A. Update content without reloading the page ✓
  • B. Change the CSS styling
  • C. Compile the code
  • D. Create a database

💡 AJAX allows web pages to update content asynchronously without needing a full page reload.

15. What is JSON commonly used for?

  • A. Exchanging data between a server and a client ✓
  • B. Styling webpages
  • C. Structuring HTML
  • D. Compiling code

💡 JSON is commonly used to exchange structured data between a server and client application.

More Programming Quizzes

View all Programming quizzes →