Coding convention

Coding convention

KG - 3rd Grade

10 Qs

quiz-placeholder

Similar activities

AMG Brand Expert Set 2

AMG Brand Expert Set 2

Professional Development

10 Qs

BNS20303 - OSH Management System

BNS20303 - OSH Management System

University

10 Qs

Exam Galaxy A14 A24

Exam Galaxy A14 A24

Professional Development

10 Qs

Latsar 23 Anti Korupsi v.1

Latsar 23 Anti Korupsi v.1

Professional Development

15 Qs

EXA II 2 CONTA PAQ CONTABLES

EXA II 2 CONTA PAQ CONTABLES

12th Grade

10 Qs

Presiozko ultzeren prebentzioaren nazioarteko eguna (2018)

Presiozko ultzeren prebentzioaren nazioarteko eguna (2018)

Professional Development

11 Qs

CARMA

CARMA

1st - 10th Grade

10 Qs

A&P revision

A&P revision

University - Professional Development

12 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).

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?