Understanding JavaScript Functions and Parameters

Understanding JavaScript Functions and Parameters

10th Grade

11 Qs

quiz-placeholder

Similar activities

AP Computer Science Principles

AP Computer Science Principles

10th - 12th Grade

14 Qs

Programming - Basic String Manipulation

Programming - Basic String Manipulation

2nd - 10th Grade

10 Qs

Chapter 7: Loops

Chapter 7: Loops

9th - 12th Grade

11 Qs

AP Computer Science Principles - Unit 7: Parameters, Returns

AP Computer Science Principles - Unit 7: Parameters, Returns

9th - 12th Grade

10 Qs

AP CSP Unit 3 Review: Looping and Random Numbers

AP CSP Unit 3 Review: Looping and Random Numbers

9th - 12th Grade

10 Qs

Unit 3 AppLab

Unit 3 AppLab

7th - 12th Grade

9 Qs

RPG (Lessons 17 - 24) Worksheet

RPG (Lessons 17 - 24) Worksheet

9th - 12th Grade

15 Qs

[Hall] 10.2 JS Functions

[Hall] 10.2 JS Functions

9th - 12th Grade

11 Qs

Understanding JavaScript Functions and Parameters

Understanding JavaScript Functions and Parameters

Assessment

Quiz

Computers

10th Grade

Medium

Created by

Rita Vasak

Used 7+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?