Create 5 clear MCQ questions for "React" (react for beginners). Format each…
- User
User: Create 5 clear MCQ questions for "React" (react for beginners). Format each question like this: Q1. Question text? a) Option1 b) Option2 c) Option3 d) Option4 Answer: a
Make sure each question follows this exact format and includes all 4 options and the correct answer. User: Create 5 clear MCQ questions for "React" (react for beginners). Format each question like this: Q1. Question text? a) Option1 b) Option2 c) Option3 d) Option4 Answer: a
Make sure each question follows this exact format and includes all 4 options and the correct answer. Assistant:
- Assistant
Q1. What is React primarily used for?
a) Building user interfaces
b) Managing databases
c) Writing server-side code
d) Styling web pages
Answer: aQ2. In React, what is a component?
a) A reusable piece of UI
b) A database connection
c) A CSS stylesheet
d) A JavaScript function for math operations
Answer: aQ3. Which of the following is the correct way to create a React component using a function?
a) function MyComponent() { return Hello; }
b) var MyComponent = 5 + 3;
c) let MyComponent = "Hello World";
d) createComponent() { return Hello; }
Answer: aQ4. What is JSX in React?
a) A syntax extension that looks like HTML and is used in React
b) A type of database
c) A CSS preprocessor
d) A JavaScript library for animations
Answer: aQ5. How do you pass data from a parent component to a child component in React?
a) Using props
b) Using state
c) Using local storage
d) Using cookies
Answer: a