Function Declaration Practice Quiz Form
Test your understanding of JavaScript function declarations with these 10 essential questions.
Which of the following is a valid way to declare a function in JavaScript?
*
function myFunc() {}
let myFunc = function() {}
const myFunc = () => {}
All of the above
What keyword is used to declare a function in JavaScript using the function declaration syntax?
*
func
function
declare
def
Fill in the blank to declare a function named greet: ______ greet() { console.log('Hello!'); }
*
Which function declaration will create a function called add that returns the sum of two parameters a and b?
*
function add(a, b) { return a + b; }
function add(a + b) { return a, b; }
function add(a, b) return a + b;
function add(a, b): return a + b
Write the arrow function syntax for a function named multiply that takes two parameters and returns their product.
*
True or False: Function declarations are hoisted in JavaScript.
*
True
False
Which of these is NOT a valid function name in JavaScript?
*
_myFunction
$myFunction
123myFunction
myFunction123
Fill in the blank to call the function named sayHello: ________();
*
What will be logged to the console? function test() { return 'Quiz'; } console.log(test());
*
Quiz
test
undefined
Error
Write a function declaration named square that takes one parameter and returns its square.
*
Submit Quiz
Should be Empty: