Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

callback in js

function greeting(name) {
  alert('Hello ' + name);
}

function processUserInput(callback , {
  var name = prompt('Please enter your name.');
  callback(name);
}}

processUserInput(greeting);
 
PREVIOUS NEXT
Tagged: #callback #js
ADD COMMENT
Topic
Name
8+1 =