Qual é a saída?

Qual é a saída?

University

10 Qs

quiz-placeholder

Similar activities

Konsep Berpikir Komputasional

Konsep Berpikir Komputasional

11th Grade - University

10 Qs

Red-Black Tree

Red-Black Tree

University

12 Qs

Club Coding Quiz - BCA

Club Coding Quiz - BCA

University

10 Qs

Multimedia Delivery Quiz

Multimedia Delivery Quiz

12th Grade - University

15 Qs

Final Exam - Logic Design

Final Exam - Logic Design

University

12 Qs

Pre-Test Host Hardening (Keamanan Jaringan)

Pre-Test Host Hardening (Keamanan Jaringan)

12th Grade - University

10 Qs

CLC Unit 2 Lesson 1,2,3 and 4 Quiz

CLC Unit 2 Lesson 1,2,3 and 4 Quiz

University

12 Qs

Qual é a saída?

Qual é a saída?

Assessment

Quiz

Information Technology (IT)

University

Easy

Created by

Ricardo Loureiro Soares

Used 14+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

console.log(1 + '2' + '2')

122
22
12
1222

Answer explanation

  • 1 + '2' → o número 1 é convertido para string e concatenado com '2', resultando em '12'.

  • '12' + '2' → concatenação de strings, resultando em '122'.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

function soma(a, b) {

return a + background;

}

console.log(soma(10, "20"));

SyntaxError: Unexpected token
ReferenceError: b is not defined
ReferenceError: background is not defined
TypeError: a is not a number

Answer explanation

  • A variável background não foi definida.

  • Isso causará um erro de referência (ReferenceError).

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

let x = 1

setTimeout(() => console.log(x), 999);

x = 2;

undefined
3
2
1

Answer explanation

  • setTimeout executa o callback depois de 999ms.

  • Enquanto isso, x é atualizado para 2.

  • O valor impresso será o valor mais recente de x, ou seja, 2.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

console.log(typeof typeof 1)

undefined
boolean
number
string

Answer explanation

console.log(typeof typeof 1)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

const array = [1, 2, 3];

array[10] = 10;

console.log(array.length);

9
11
10
5

Answer explanation

  • array[10] = 10 adiciona um item no índice 10 (11ª posição).

  • Os índices entre 3 e 9 ficam undefined, mas o comprimento (length) vira 11.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

function misterio(texto) {

return texto.split('').reverse().join('');

}

console.log(misterio("casa"));

casa
asac
saca
asacasa

Answer explanation

  • .split('') → separa a string em caracteres: ['c','a','s','a']

  • .reverse() → inverte: ['a','s','a','c']

  • .join('') → junta: 'asac'

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

for (let i = 5; i > 0; i--) {

console.log(i * 2);

}

0, -2, -4, -6, -8
12, 10, 8, 6, 4
10, 8, 6, 4, 2
5, 3, 1, -1, -3

Answer explanation

  • i = 5 → 5*2 = 10

  • i = 4 → 4*2 = 8

  • i = 3 → 6, 2 → 4, 1 → 2

Saída: 10, 8, 6, 4, 2

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?