CS401A's Pre-Finals: Fundaments of Web Prog. Module 06 Flashcards

For pre-final and final exams.

1
Q

is a separate piece of code intended to perform a specific task.

A

A function in JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

It is usually assigned a specific name that is called many times in different program sections.

A

A function in JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

It also encloses a repeated sequence of instructions in the program to increase the code’s readability.

A

A function in JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

aims to divide the code into logically independent parts to make a long program that is not a sequence of instructions easier to write and understand.

A

A JavaScript function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It also allows for easy testing of code fragments enclosed in functions independent from the rest of the program.

A

A JavaScript function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Declaring Functions

starts with the function keyword followed by the function name, which follows the same rule as variable names that must relate to the condition to be done.

A

A function statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Declaring Functions

It is then followed by parentheses that enclose function parameters.

A

A function statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Declaring Functions

It is followed by the function body, which contains the code block.

A

A function statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Calling Functions

To call a function, the function name is

A

written followed by parentheses and the instruction it should do next.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

causes the function to end exactly wherever this word is placed in the instruction.

A

return Functions
The return keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

It also allows programmers to return a given value from inside the function to the place where it was called.

A

return Functions
The return keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

return Functions

is only usable inside its corresponding function block,
is usually declared inside a function,

A

A local variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

return Functions

is usable anywhere in the program.
is declared outside any block or function

A

while a global variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

are names seperated by commas, placed inside the parenthesis after the function name, and treated as local variables.

A

Parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Parameters

they refer to the values given when a function is called.

A

Recalling arguments,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly