KA JS Functions

KA JS Functions

KG - University

7 Qs

quiz-placeholder

Similar activities

Python Quiz

Python Quiz

6th - 8th Grade

9 Qs

Session 2 | U

Session 2 | U

University

10 Qs

¡Frontend check!

¡Frontend check!

Professional Development

10 Qs

Python Quiz  -  5

Python Quiz - 5

4th - 11th Grade

10 Qs

Tutorium 4 - Prog2

Tutorium 4 - Prog2

University

7 Qs

Функции C++

Функции C++

10th Grade

12 Qs

Revision - Optional Lesson

Revision - Optional Lesson

12th Grade

7 Qs

Pemrograman Android 01 - Pengantar Android & Kotlin

Pemrograman Android 01 - Pengantar Android & Kotlin

University

6 Qs

KA JS Functions

KA JS Functions

Assessment

Quiz

Computers

KG - University

Medium

Used 336+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let's say you defined a function called startTheParty in your program. What line of code would call that function?
startTheParty;
startTheParty();
var startTheParty = true;
var startTheParty();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You want to define a function for drawing houses and then use it to draw multiple houses. Where should you define that function?
At the beginning of the program, before you call it.
Right after you call it.
At the very end of the program.
It doesn't matter one bit!

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these lines of code correctly define a function?
var dropTheBeat = function() [ ];
dropTheBeat = function() { };
var dropTheBeat = function() { };
var dropTheBeat = function { };

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these lines of code define a function that takes 2 parameters?
var funkyFunc = function(note, tempo) { };
var funkyFunc = function() { };
var funkyFunc = function([note, tempo]) { };
var funkyFunc = function() {
   var note, tempo;
}; 

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You have a function named funkyFunc that takes 2 parameters. What line of code validly calls it and passes in 2 values?
funkyFunc = 'A', 20;
funkyFunc('A' 20);
funkyFunc(['A', 20]);
funkyFunc('A', 20);

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You've defined a function named calcAge that takes three parameters (day/month/year) and returns a value. How do you call that function and store the resulting value?
var calcAge(24, 6, 1984);
var age = calcAge(24, 6, 1984);
var age = calcAge(24/6/1984);
var age = calcAge = 24, 6, 1984;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword do you need to use if you want your function to return a value?
return
echo
sendback
reply