Qual é a saída?

Qual é a saída?

University

10 Qs

quiz-placeholder

Similar activities

Вопросы по C# от Naviuki

Вопросы по C# от Naviuki

University

12 Qs

JavaScript-Day2

JavaScript-Day2

University

15 Qs

codingม.ต้น

codingม.ต้น

12th Grade - University

15 Qs

Introducción a Desarrollo de Software

Introducción a Desarrollo de Software

University

8 Qs

ISFT 225 - Semana 1

ISFT 225 - Semana 1

University

6 Qs

Tut05

Tut05

University

11 Qs

Klasifikasi Media Belajar ICT di PAUD

Klasifikasi Media Belajar ICT di PAUD

University

10 Qs

Intro to JS: Functions, Scope & Objects

Intro to JS: Functions, Scope & Objects

11th Grade - University

8 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?