
Qual é a saída?
Authored by Ricardo Loureiro Soares
Information Technology (IT)
University
Used 14+ times

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')
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'.
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"));
Answer explanation
A variável background não foi definida.
Isso causará um erro de referência (ReferenceError).
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;
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.
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)
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);
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.
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"));
Answer explanation
.split('') → separa a string em caracteres: ['c','a','s','a']
.reverse() → inverte: ['a','s','a','c']
.join('') → junta: 'asac'
.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);
}
Answer explanation
i = 5 → 5*2 = 10
i = 4 → 4*2 = 8
i = 3 → 6, 2 → 4, 1 → 2
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?