Coding convention

Coding convention

KG - 3rd Grade

10 Qs

quiz-placeholder

Similar activities

Introducción a python

Introducción a python

Professional Development

10 Qs

KC35

KC35

Professional Development

10 Qs

AXIE 101

AXIE 101

KG - Professional Development

10 Qs

Trades 2021 Am I ready for  learning at Home?

Trades 2021 Am I ready for learning at Home?

12th Grade

15 Qs

Floor finishes

Floor finishes

University

10 Qs

L4 revision: ITOD Innovation Processes

L4 revision: ITOD Innovation Processes

University - Professional Development

10 Qs

Browsing

Browsing

1st Grade

10 Qs

Google Ads Fundamentals

Google Ads Fundamentals

Professional Development

15 Qs

Coding convention

Coding convention

Assessment

Quiz

Professional Development

KG - 3rd Grade

Practice Problem

Medium

Created by

Phuong Q

Used 1+ 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

30 sec • 1 pt

Which of the following is incorrect branch naming.

Bugfix: bugfix/*

Feature: feature/*

Hotfix: hotfix/*

Release: master/*

Answer explanation

Release: release/*

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is prefered function declaration?

function test() {}

const test = () => {}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import * as React from 'react'

YES

NO

Answer explanation

- This is the new convention for importing React: Introducing the New JSX Transform – React Blog

- Easier to upgrade and supports tree-shaking.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is Function Declaration

function Button(): React.ReactElement {/* */}

const Button: React.FC = () => {/* */}

Answer explanation

- Globals are bad

- Explicit types over generalized ones

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Always use React Fragment to render multiple React components over array and wrapper div:

1function ComponentA() {

return <>

<ComponentB />

<ComponentC />

</>

}

YES

NO

Answer explanation

- A React Fragment doesn’t create a HTML tag, it helps improve performance, and prevent bugs.

- Unlike array, a React Fragment doesn’t need to specify key prop to its children.

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

[Iterating objects] Which of the following statements are preferred?

for (const x in someObj) { if (!someObj.hasOwnProperty(x)) continue;}

for (const x in someObj) { }

for (const x of Object.keys(someObj)) { }

for (const [key, value] of Object.entries(someObj)) { }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

someArr.forEach((item, index) => {

someFn(item, index);

});

SHOULD

SHOULD NOT

Answer explanation

Do not use Array.prototype.forEach, Set.prototype.forEach, and Map.prototype.forEach. They make code harder to debug and defeat some useful compiler checks (e.g. reachability).

Access all questions and much more by creating a free account

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?