
Understanding JavaScript Functions and Parameters
Authored by Rita Vasak
Computers
10th Grade
Used 7+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for declaring a function named `myFunction` in JavaScript?
`function myFunction() {}`
`declare myFunction() {}`
`def myFunction() {}`
`create myFunction() {}`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a function expression in JavaScript?
`function myFunc() {}`
`var myFunc = function() {}`
`function: myFunc() {}`
`myFunc function() {}`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the term for the values passed to a function when it is called?
Parameters
Arguments
Variables
Constants
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following function, what is the parameter? ```javascript function greet(name) { return "Hello, " + name; } ```
greet
name
"Hello, "
return
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following function return? ```javascript function add(a, b) { return a + b; } ```
The sum of `a` and `b`
The product of `a` and `b`
`a` minus `b`
`b` minus `a`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code:
```javascript
var x = 10;
function example() {
var x = 20;
println(x); }
example(); ```
What will be printed to the screen?
10
20
30
undefined
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you ensure a function returns a value in JavaScript?
By using the `return` keyword followed by the value
By using the `output` keyword followed by the value
By using the `send` keyword followed by the value
By using the `give` keyword followed by the value
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?
Similar Resources on Wayground
10 questions
Innovations of Technology
Quiz
•
7th - 10th Grade
15 questions
Chapter 8 by PD
Quiz
•
10th Grade
15 questions
4.6.4 Logic Gates
Quiz
•
10th Grade - Professi...
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
13 questions
Networks - Introduction
Quiz
•
10th Grade
8 questions
Overview of IT
Quiz
•
6th Grade - University
10 questions
UNIT 2.4 LOGIC
Quiz
•
10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade