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

For pre-final and final exams. (16 cards)

1
Q

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

A

Function Syntax (OpenEDG, 2023)
A function in JavaScript || A JavaScript function

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

Function Syntax (OpenEDG, 2023)
A function in JavaScript || A JavaScript function

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

Function Syntax (OpenEDG, 2023)
A function in JavaScript || A JavaScript function

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

Function Syntax (OpenEDG, 2023)
A function in JavaScript || 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

Function Syntax (OpenEDG, 2023)
A function in JavaScript || A JavaScript function

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

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

A

Function Syntax (OpenEDG, 2023)
Functions
A function statement
function
function

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

Declaring
It is then followed by parentheses that enclose \_\_\_\_\_\_\_\_ \_\_\_\_\_\_\_\_\_\_.

A

Function Syntax (OpenEDG, 2023)
Functions
A function statement
function parameters

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

Declaring
It is followed by the \_\_\_\_\_\_\_\_ body, which contains the code block.

A

Function Syntax (OpenEDG, 2023)
Functions
A function statement
function

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

Calling
To call a function, the function name is

A

Function Syntax (OpenEDG, 2023)
Functions
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

Function Syntax (OpenEDG, 2023)
return Statement
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

Function Syntax (OpenEDG, 2023)
return Statement
The return keyword

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

return Statement
Side note:
is only usable inside its corresponding function block,
is usually declared inside a function,

A

Function Syntax (OpenEDG, 2023)
A local variable

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

return Statement
Side note:
is usable anywhere in the program.
is declared outside any block or function

A

Function Syntax (OpenEDG, 2023)
while a global variable

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

These are only optional to use in functions.

A

Function Syntax (OpenEDG, 2023)
Parameters

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

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

A

Function Syntax (OpenEDG, 2023)
Parameters

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

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

A

Function Syntax (OpenEDG, 2023)
Recalling arguments,