question,option1,option2,option3,option4,answer,difficulty What is JSX in React?,JavaScript XML,JavaScript Extension,JavaScript Execution,JSON Extension,JavaScript XML,low Which method is used to render a React component?,renderComponent(),render(),createElement(),renderReact(),render(),low What is the default state of a React component?,null,undefined,false,empty object,empty object,low Which hook is used for managing state in functional components?,useState(),useEffect(),useReducer(),useContext(),useState(),low What is the purpose of `componentDidMount()` in React?,It is used to fetch data after the component is mounted,It initializes the state,It renders the component,It handles events,It is used to fetch data after the component is mounted,low What is the purpose of `props` in React?,To pass data from parent to child components,To store component state,To handle events,To render JSX,To pass data from parent to child components,low Which of the following is used to style React components?,CSS,JSX,JavaScript,HTML,CSS,low What is the purpose of the `useEffect()` hook in React?,To manage side effects in functional components,To update the state,To define JSX,To render components,To manage side effects in functional components,low What is the primary method for updating state in a React component?,setState(),useState(),updateState(),changeState(),setState(),low How do you create a class component in React?,class Component extends React.Component,component Component extends React.Component,class Component extends BaseComponent,function Component(),class BaseComponent extends React.Component,class Component extends React.Component,low Which of the following is the correct way to create a functional component?,function MyComponent(),const MyComponent = () => {},class MyComponent(),const MyComponent = function() {},const MyComponent = () => {},low What does `map()` do in JavaScript?,It creates a new array from the result of calling a function on every element in an array,It sorts an array,It filters elements of an array,It merges two arrays,It creates a new array from the result of calling a function on every element in an array,low What is the purpose of `state` in React?,To hold dynamic data for the component,To pass data between components,To render HTML,To call functions,To hold dynamic data for the component,low What is the correct syntax for setting a default prop value in React?,MyComponent.defaultProps = { prop: value },MyComponent.propTypes = { prop: value },MyComponent.props = { prop: value },MyComponent.default = { prop: value },MyComponent.defaultProps = { prop: value },low What is the correct way to add a key to a list of components in React?,key={index},id={index},ref={index},index={key},key={index},low What is Redux?,A state management library for JavaScript,An HTTP request library,A React component library,A CSS framework,A state management library for JavaScript,low In Redux, what does the store contain?,Actions,Reducers,State,Views,State,low Which method in Redux is used to dispatch actions?,dispatch(),setState(),updateState(),callAction(),dispatch(),low What is a reducer in Redux?,A function that handles actions and updates the state,An action that triggers state change,A function that initializes the store,An event listener, A function that handles actions and updates the state,low Which function is used to create a Redux store?,createStore(),initializeStore(),newStore(),configureStore(),createStore(),low What is the role of an action in Redux?,To describe what happened in the app,To update the state,To initialize the store,To store data,To describe what happened in the app,low How do you connect Redux to a React component?,useState(),useEffect(),connect(),useReducer(),connect(),low What does `useDispatch()` hook do in Redux?,It dispatches an action,It updates the state,It connects the component to Redux store,It subscribes to the store,It dispatches an action,low What is the purpose of `useSelector()` in Redux?,To read state from the store,To update the state in the store,To dispatch an action,To connect the component to the Redux store,To read state from the store,low What is the function of the `combineReducers()` method in Redux?,To combine multiple reducers into a single reducer,To merge multiple stores,To create multiple actions,To update state in multiple reducers,To combine multiple reducers into a single reducer,medium What is the correct way to access an object’s property in JavaScript?,object.property,object->property,object[property],object:property,object.property,medium What is the use of `super()` in JavaScript classes?,To call the parent class constructor,To access properties of the current class,To define a method,To define a variable,To call the parent class constructor,medium What does the `this` keyword refer to in JavaScript?,The current object,The global object,The previous object,The parent object,The current object,medium How do you bind a method to the current instance in a JavaScript class?,using `.bind()`,using `.call()`,using `.apply()`,using `.this()`,using `.bind()`,medium How do you prevent an event from bubbling in JavaScript?,event.stop(),event.preventDefault(),event.stopPropagation(),event.cancel(),event.stopPropagation(),medium What is the purpose of `componentWillUnmount()` in React?,It is called before a component is removed from the DOM,It updates the state,It is called after the component mounts,It is used to fetch data,It is called before a component is removed from the DOM,medium What is `localStorage` in JavaScript?,A web storage mechanism to store data locally,An API to fetch data from a server,A function to store data in cookies,An array to hold data,A web storage mechanism to store data locally,medium What does the `filter()` method do in JavaScript?,It creates a new array with elements that pass a test,It combines multiple arrays into one,It reverses the order of an array,It creates a new array from an existing array,It creates a new array with elements that pass a test,medium What is the correct syntax to import a named export in JavaScript?,import { name } from 'module',import name from 'module',import { name } from module,import 'module',import { name } from 'module',medium What is a promise in JavaScript?,An object representing the eventual completion or failure of an asynchronous operation,An object that handles events,An object to store functions,An object for regular expressions,An object representing the eventual completion or failure of an asynchronous operation,medium How do you set a value in the sessionStorage in JavaScript?,sessionStorage.setItem('key', 'value'),sessionStorage.set('key', 'value'),sessionStorage.save('key', 'value'),sessionStorage.put('key', 'value'),sessionStorage.setItem('key', 'value'),medium Which of the following is used to create a responsive design in CSS?,Media Queries,Positioning,Flexbox,Grid,Media Queries,medium What is the purpose of the `z-index` property in CSS?,To define the stacking order of elements,To define the width of elements,To position elements,To define the height of elements,To define the stacking order of elements,medium What is the default display property of a `div` element in CSS?,block,inline,flex,grid,block,medium How do you center a div element using Flexbox in CSS?,display: flex; justify-content: center; align-items: center;,display: flex; center: true;,display: center; justify-content: flex; align-items: center;,center: true; display: flex;,display: flex; justify-content: center; align-items: center;,medium What does the `float` property do in CSS?,It floats an element to the left or right of its container,It centers an element within its container,It defines the size of the container,It adds margins to an element,It floats an element to the left or right of its container,medium Which property is used to change the background color of an element in CSS?,background-color,color,background,image,background-color,medium What does the `position: absolute` property do in CSS?,Positions an element relative to its nearest positioned ancestor,Positions an element relative to the viewport,Positions an element relative to its parent,Positions an element at a fixed position,Positions an element relative to its nearest positioned ancestor,medium How do you hide an element in CSS?,display: none;,visibility: hidden;,opacity: 0;,display: hidden;,display: none;,medium How do you make a CSS element responsive?,Use media queries,Use fixed widths,Use absolute positioning,Use float properties,Use media queries,medium What is the difference between `inline` and `block` elements in CSS?,Inline elements do not start on a new line,Block elements take up the full width of their parent,Inline elements take up the full width,Block elements start on a new line,Inline elements do not start on a new line,medium What is the correct way to link a CSS file to an HTML document?,,,,