JavaScript Functions Test

Check your knowledge of function declarations, parameters, closures, callbacks and arrow functions.

6 questions. Choose the best answer for each question, then review every explanation.

Question 1 of 6

1 of 6
Question 1Which function can normally be called before its declaration appears in the source?
Question 2How does an arrow function determine this?
Question 3What value is returned?
function greet(name = 'Sam') {
    return `Hello ${name}`;
}

greet();
Question 4What does a rest parameter collect?
function total(...values) {}
Question 5What is a closure?
Question 6What is a callback?