FSD Quiz-2

FSD Quiz-2

University

10 Qs

quiz-placeholder

Similar activities

WEB DESIGN

WEB DESIGN

University

12 Qs

HTML Basics

HTML Basics

University

12 Qs

HTML LEC1

HTML LEC1

University

8 Qs

HTML Table Quiz

HTML Table Quiz

University

15 Qs

HTML Quiz

HTML Quiz

University

15 Qs

ทบทวน Dreamweaver CS6

ทบทวน Dreamweaver CS6

6th Grade - University

10 Qs

Знаешь ли ты CSS?

Знаешь ли ты CSS?

University

10 Qs

Review chapter 7,and 8

Review chapter 7,and 8

University

11 Qs

FSD Quiz-2

FSD Quiz-2

Assessment

Quiz

Computers

University

Medium

Created by

Varalaxmi P N V

Used 2+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?