FSD Quiz-2

FSD Quiz-2

University

10 Qs

quiz-placeholder

Similar activities

Listen in Python

Listen in Python

University

10 Qs

Chap 1: What is a program made of?

Chap 1: What is a program made of?

University

13 Qs

MS Excel - Day 04

MS Excel - Day 04

University

10 Qs

Excel_Test_bài 1

Excel_Test_bài 1

University

15 Qs

Lourdes Amaranta Ayala Gracia

Lourdes Amaranta Ayala Gracia

8th Grade - University

10 Qs

cp06-01-1D-Array

cp06-01-1D-Array

University

10 Qs

DAA quiz2

DAA quiz2

University

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

FSD Quiz-2

FSD Quiz-2

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Varalaxmi P N V

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which one is a correct way of sending the value 'John' via the 'firstname' property to the Person component?

root.render(<Person firstname='John' />);

root.render(<Person props(firstname='John') />);

root.render(Person(firstname='John'));

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which is a correct way of receiving, and using a prop named firstname, in a function class?

function Person(firstname) {
    return <h2>My name is { firstname }!</h2>;
}

function Person(props) {
    return <h2>My name is { props.firstname }!</h2>;
}

Both of the above is correct

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In React, which is a correct way of adding a mouseover event to trigger a function called 'run_now'?

<div onmouseover='run_now()'>Lorum Ipsum</div>

<div onMouseover='run_now'>Lorum Ipsum</div>

<div onMouseover={run_now}>Lorum Ipsum</div>

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which one of these two code blocks is a correct way of adding a conditional statement in React?

function Glass() {
    return (
        <>
            {5 > 2 && <h2>Hello</h2> }
        </>
    );
}

function Glass() {
    return (
        <>
            {5 > 2 &&} <h2>Hello</h2>
        </>
    );
}

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider the following code:function Family() {

    const names = ['Jane', 'John', 'Mike'];

    return (

        <>

            <ul>

                {names.map((x) => <li>{x}</li>)}

            </ul>

        </>

    );

What will be the return value?

Jane

       John

       Mike

Jane

Jane

      Jane

       Jane

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Complete this statement to include a click event handler.

k Me!</button>

 }>Click Me!</button>

<button _________={handle} <click me></button>

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Add the attribute that allows React to keep track of elements in lists.

function GroceryList() {

  const items = [

    {id: 1, name: 'bread'},

    {id: 2, name: 'milk'},

    {id: 3, name: 'eggs'}

  ];

 

  return (

    <>

      <h1>Grocery List</h1>

      <ul>

        {items.map((item) => <li _____ ={item.id}>{item.name}</li>)}

      </ul>

    </>

  );

}

 

const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(<GroceryList />);

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?