Any2Quiz
Computer Science / Languages / JavaScript

Frameworks Quiz - Languages JavaScript

Free practice quiz: Frameworks (Languages JavaScript). 52 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

Play all 52 questions free

Sample questions

  1. Which of the following is a client-side JavaScript framework primarily used for building user interfaces?

    1. Node.js
    2. React
    3. Express.js
    4. AngularJS (AngularJS 1.x)
    Show answer

    Answer: B. React

    React is a popular JavaScript library (often referred to as a framework) for building user interfaces, primarily focused on the view layer of an application. Node.js and Express.js are backend technologies, and AngularJS (the older version) is also a client-side framework but React has a different architectural approach.

  2. Which of the following is a characteristic of Svelte?

    1. It relies heavily on a virtual DOM.
    2. It compiles components into highly efficient imperative JavaScript code at build time.
    3. It is primarily a library for managing application state.
    4. It requires a runtime library on the client for all its functionality.
    Show answer

    Answer: B. It compiles components into highly efficient imperative JavaScript code at build time.

    Svelte is a compiler. Instead of using a virtual DOM or shipping a runtime library, Svelte compiles your components into small, vanilla JavaScript modules that efficiently update the DOM when state changes.

  3. Which React lifecycle method is invoked immediately after a component's updates are flushed to the DOM?

    1. componentDidMount
    2. shouldComponentUpdate
    3. componentDidUpdate
    4. getSnapshotBeforeUpdate
    Show answer

    Answer: C. componentDidUpdate

    `componentDidUpdate()` is called after the component updates and the changes have been rendered to the DOM. `getSnapshotBeforeUpdate()` is called before the DOM changes.

  4. Which of the following is a meta-framework built on top of React, providing features like SSR, SSG, and API routes?

    1. Angular
    2. Vue.js
    3. Next.js
    4. Ember.js
    Show answer

    Answer: C. Next.js

    Next.js is a popular React framework that enables Server-Side Rendering (SSR) and Static Site Generation (SSG) for server-rendered React applications, as well as API routes for building backends.

  5. What is the purpose of `React.memo`?

    1. To create a higher-order component.
    2. To memoize a functional component, preventing re-renders if its props have not changed.
    3. To manage state in functional components.
    4. To define prop types for a component.
    Show answer

    Answer: B. To memoize a functional component, preventing re-renders if its props have not changed.

    `React.memo` is a higher-order component that memoizes a functional component. It performs a shallow comparison of the component's props. If the props are the same, React skips re-rendering the component and reuses the last rendered result.

Take the full quiz

More quizzes

Browse all JavaScript quizzes