Qual é a definição de uma função em JavaScript?
PENSAMENTO_COMPUTACIONAL_Funções em JavaScript

Quiz
•
Information Technology (IT)
•
11th Grade
•
Hard
Marcelo Guilherme Kühl
Used 6+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Um bloco de código projetado para executar uma tarefa específica.
Um tipo de variável que armazena múltiplos valores.
Um método para iterar sobre arrays.
Uma estrutura de controle de fluxo.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Como você define uma função chamada `soma` que recebe dois parâmetros `a` e `b` e retorna a soma deles?
`function soma(a, b) { return a + b; }`
`var soma = function(a, b) { return a * b; }`
`let soma = (a, b) => a - b;`
`const soma = function(a, b) { return a / b; }`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
O que uma função em JavaScript retorna por padrão se não houver uma instrução `return`?
`undefined`
`null`
`0`
`false`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual é o escopo de uma variável declarada com `var` dentro de uma função?
Escopo global
Escopo de bloco
Escopo de função
Escopo de módulo
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Como você define uma função anônima em JavaScript?
`function() { console.log("Olá"); }`
`function anonima() { console.log("Olá"); }`
`let anonima = function() { console.log("Olá"); }`
`const anonima = () => { console.log("Olá"); }`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual das seguintes opções é um exemplo de recursividade em JavaScript?
`function fatorial(n) { if (n === 0) { return 1; } else { return n * fatorial(n - 1); } }`
`function soma(a, b) { return a + b; }`
`function loop() { for (let i = 0; i < 10; i++) { console.log(i); } }`
`function print() { console.log("Olá"); }`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual é a saída da seguinte função? ```javascript function exemplo() { var x = 10; if (true) { var x = 20; console.log(x); } console.log(x); } exemplo(); ```
10, 10
20, 10
20, 20
10, 20
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
Aula 5

Quiz
•
9th - 12th Grade
10 questions
Quiz aula 7

Quiz
•
9th - 12th Grade
5 questions
2TDS - Programação Frontend - Aula 03

Quiz
•
11th Grade
10 questions
Modelo OSI e TCP/IP (2)

Quiz
•
10th Grade - University
15 questions
Motherboard Functionality Quiz

Quiz
•
8th Grade - University
10 questions
História do Computador

Quiz
•
1st Grade - University
8 questions
Quiz sobre P5.js e JavaScript

Quiz
•
1st Grade - University
10 questions
Variáveis e Atribuição em JavaScript

Quiz
•
11th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University