Coding convention

Coding convention

KG - 3rd Grade

10 Qs

quiz-placeholder

Similar activities

Conceitos iniciais - Linguagem C

Conceitos iniciais - Linguagem C

2nd Grade

10 Qs

PHP BASIC

PHP BASIC

University

10 Qs

Java Lab6

Java Lab6

Professional Development

10 Qs

JS Quiz

JS Quiz

Professional Development

14 Qs

M1 - Bài 4 - Array (Bài tập cuối buổi)

M1 - Bài 4 - Array (Bài tập cuối buổi)

1st - 3rd Grade

11 Qs

Fundamentos Segundo Test

Fundamentos Segundo Test

Professional Development

8 Qs

Javascript (Part 2)

Javascript (Part 2)

1st - 2nd Grade

6 Qs

ES6 and babel on automation test

ES6 and babel on automation test

KG - 5th Grade

10 Qs

Coding convention

Coding convention

Assessment

Quiz

Professional Development

KG - 3rd Grade

Medium

Created by

Phuong Q

Used 1+ times

FREE Resource

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