Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Callback Function

function greeting(name) {
  alert(`Hello, ${name}`);
}

function processUserInput(callback) {
  const name = prompt("Please enter your name.");
  callback(name);
}

processUserInput(greeting);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Callback #Function
ADD COMMENT
Topic
Name
1+8 =