CallbackParametersInCaller
DRAFT
Observed

CallbackParametersInCaller
Incorrect

Parameters of a callback function may be written as parameters of the caller function

Correct

A function that expects a callback has that callback function as a parameter

Symptoms
How do you know your students might have this misconception?

Many functions in JavaScript are higher-order functions that accept “callback” functions as arguments. A classic example can be shown with the forEach function, that calls a function on each element of an array.

A student holding this misconception may write code like this:

arr.forEach(element) {
  // Do something with element
}