crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Callbacks</h2> <p>Do a calculation and then display the result.</p> <p id="demo"></p> <script> function myDisplayer(some) { document.getElementById("demo").innerHTML = some; } function myCalculator(num1, num2, myCallback) { let sum = num1 + num2; myCallback(sum); } myCalculator(5, 5, myDisplayer); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBDYWxsYmFja3M8L2gyPg0KDQo8cD5EbyBhIGNhbGN1bGF0aW9uIGFuZCB0aGVuIGRpc3BsYXkgdGhlIHJlc3VsdC48L3A+DQoNCjxwIGlkPSJkZW1vIj48L3A+DQoNCjxzY3JpcHQ+DQpmdW5jdGlvbiBteURpc3BsYXllcihzb21lKSB7DQogIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0gc29tZTsNCn0NCg0KZnVuY3Rpb24gbXlDYWxjdWxhdG9yKG51bTEsIG51bTIsIG15Q2FsbGJhY2spIHsNCiAgbGV0IHN1bSA9IG51bTEgKyBudW0yOw0KICBteUNhbGxiYWNrKHN1bSk7DQp9DQoNCm15Q2FsY3VsYXRvcig1LCA1LCBteURpc3BsYXllcik7DQo8L3NjcmlwdD4NCg0KPC9ib2R5Pg0KPC9odG1sPg==