Intro to JS: Functions, Scope & Objects
Quiz
•
Information Technology (IT)
•
11th Grade
•
Practice Problem
•
Medium
Tiffany Hale
Used 3+ times
FREE Resource
Enhance your content in a minute
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the keyword used to define a function in JavaScript?
define
function
method
procedure
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In the context of JavaScript, what does the term "scope" refer to?
The number of lines in a function
The accessibility of variables and functions in different parts of the code
The speed at which a function executes
The size of the code block
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given the function definition `function add(a, b) { return a + b; }`, what will `add(3, 4)` return?
34
7
12
undefined
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code snippet: ```javascript var color = 'blue'; function changeColor() { var color = 'yellow'; console.log(color); } changeColor(); console.log(color); ``` What will be logged to the console?
yellow, blue
blue, yellow
yellow, yellow
blue, blue
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code? ```javascript var myDog = { name: 'Buddy', age: 5 }; delete myDog.age; console.log(myDog.age); ```
5
undefined
null
Error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Analyze the following code and determine what it does: ```javascript function multiplyByTwo(n) { return n * 2; } var result = multiplyByTwo(4); console.log(result); ```
It multiplies 4 by 2 and logs 8
It adds 2 to 4 and logs 6
It divides 4 by 2 and logs 2
It logs an error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given the object `var car = { brand: 'Toyota', model: 'Corolla' };`, how can you check if the property `model` exists in the object?
car.hasOwnProperty('model')
'model' in car
Both A and B
Neither A nor B
8.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
When defining a function, the definition must occur before it is called.
true
false
Similar Resources on Wayground
10 questions
Survey DFT10173
Quiz
•
University
11 questions
G 10- Understanding Main Memory and Cache
Quiz
•
10th Grade - University
10 questions
Teknologi Informasi dan Komunikasi
Quiz
•
11th Grade
10 questions
Ethics in Research Quiz
Quiz
•
University
10 questions
Vb Codes Quiz 1
Quiz
•
University
10 questions
DB-Quiz1
Quiz
•
University
12 questions
CLC Lesson 8&9 Quiz
Quiz
•
University
10 questions
java2/67
Quiz
•
12th Grade - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Information Technology (IT)
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
11 questions
Solve Systems of Equations and Inequalities
Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 2 Review (CED)
Quiz
•
9th - 12th Grade
20 questions
Winter Jokes
Quiz
•
5th - 12th Grade
