Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 551 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 551 Bytes

Javascript Callbacks | Mr Yenagandula

Callbacks In Detail

  • Normally in javascript functions called as call back.
  • A function accepting parameter as function is also called callback.

Steps:

  • Create function in javascript file and pass as argument in another function.

Example (1)

  function task(taskStatus) {
    console.log('task()')
    console.log('task-- started');
    console.log('task-- completed');
    taskStatus('task completed');
    }

    task((status) => {
        console.log('callback',status);
    })