Exam | All Correctly Provided Answers 2025/2026
How do you declare a function?
Correct answer: function myfunction(){}
What processes a function's statements?
Correct answer: Calling statement
What happens if you define a function but do not call it?
Correct answer: Nothing
How do you call this function?
Correct answer: myfunction()
What is used to output values from a function?
Correct answer: Return
What type of variable is declared within a function and available only from
within that function?
Correct answer: Local variable
What type of variable is available throughout the entire script?
Correct answer: Global variable
, What is a value or expression containing data or code that is passed on to
a function?
Correct answer: Argument
What describes when values are passed to a function, and the function's
parameters receive a copy of its argument's value?
Correct answer: Pass by reference
Example:
function myfunction(x){ return x; }
var num = 2;
myfunction(num);
What describes when values are passed to a function, and the function's
parameters receive its argument's actual value?
Correct answer: Pass by value
Example:
function myfunction(x){ return x; }
myfunction(2);
Which method determines whether a value is a number?
Correct answer: isNaN()
Which method converts a string to its integer equivalent?
Correct answer: parseInt()
Which method converts a string to its floating-point decimal equivalent?