current work

This commit is contained in:
2024-09-17 14:41:00 -05:00
commit fa7ac2949b
13 changed files with 183 additions and 0 deletions

View File

@ -0,0 +1,19 @@
A function with no parameters that prints how many times its
been called. Hint: define a variable outside of the function to
keep track of the number of calls, like we did in the “Side
Effects” section on page 77.
<html><body><script>
let a = 0
let b = 0
let c = 0
function calledcallback (){a++;console.log(`calledcallback calls: ${a}`)}
callback = function () {b++;console.log(`callback calls: ${b}`)}
cb = () => {c++;console.log(`cb calls: ${c}`)}
calledcallback()
callback()
cb()
</script></body></html>