Search Header Logo

Qual é a saída?

Authored by Ricardo Loureiro Soares

Information Technology (IT)

University

Used 14+ times

Qual é a saída?
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

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?