WorksheetsJavaScript Function
Total questions: 8
Worksheet time: 4mins
What is a JavaScript function?
A type of variable
A set of instructions that performs a specific task
A data structure used to store multiple values
An operator that performs arithmetic operations
What is the keyword used to define a function in JavaScript?
const
define
def
function
What is a function parameter?
The value returned by the function
The name of the function
An input passed to the function when it is called
A variable used to store the function's output
What is the syntax for calling a function in JavaScript?
functionName(argument1, argument2)
function(argument1, argument2) = functionName
functionName {argument1, argument2}
functionName.argument1(argument2)
What is the purpose of a return statement in a function?
To define the function
To call the function
To specify the value to be returned by the function
To declare a new variable inside the function
How can you pass multiple parameters to a function in JavaScript?
Separate them with a space
Separate them with a period
Separate them with a comma
Separate them with a semicolon
What is the difference between a function declaration and a function expression?
There is no difference
A function declaration can be called before it is defined
A function expression can be called before it is defined
A function expression is defined using the "this" keyword
Can a function in JavaScript have no parameters?
Yes
No
