Code Ramp
Quiz by , created more than 1 year ago

Quiz on Functions, created by Code Ramp on 19/04/2018.

318
0
0
Code Ramp
Created by Code Ramp about 6 years ago
Close

Functions

Question 1 of 5

1

Functions help make our programs more modular and let us reuse a block of code as many times as we need.

Select one of the following:

  • True
  • False

Explanation

Question 2 of 5

1

In the following code we are both defining and then calling a function. What does `a` represent in this example?

function findSum(a, b) {
return a + b;
}

var sum = findSum(5, 8);
console.log(sum);

Select one of the following:

  • a parameter

  • an argument

  • the returned value

  • the function name

Explanation

Question 3 of 5

1

In the following code we are both defining and then calling a function. What does `8` represent in this example?

function findSum(a, b) {
return a + b;
}

var sum = findSum(5, 8);
console.log(sum);

Select one of the following:

  • a parameter

  • an argument

  • the returned value

  • the function name

Explanation

Question 4 of 5

1

Select from the dropdown lists to complete the text.

The ( output, input ) of a function is often called a return value. If no value is explicitly provided the function defaults to returning ( undefined, null ).

Explanation

Question 5 of 5

1

The body of the function is the block of code contained in the curly braces. It may contain any of the following:

Select one or more of the following:

  • Conditionals

  • Loops

  • Variables

  • Other functions

Explanation