html
html
1
2
3
4
5
6
7
8
9
10
11
<!-- Created by Robin R.-->
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
/* Created by Robin R. */
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Robin R.
// Edited by AZTECCO
/*
created by Rademaker Robin 07/06/2019
Inspired by max, AZTECCO
How exactly do closures work and what are they? I will look into this further, and adjust this later, any comments are welcome
*/
/* TEST 1 - with closure
function inside the function
let count is modified within makeCounter and called by counter()
*/
function makeCounter(name) {
let count = 0;
console.log(name + " counter created!");
// this is what really makes it behave
// like a closure, you return an anonimous
// function .
// and call it directly using () from
// the variable containing this function
// A()
return function (){
console.log(name +" called "+ ++count + "times.");
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run