Skip to content

Commit 70f7c95

Browse files
author
Sascha
committed
made my closure example more clear
1 parent 96bf85a commit 70f7c95

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎assignments/closure.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
const cat = 'kittie';
44
function returnCat () {
55
let inside_variable = 'so much private';
6-
return cat;
6+
let cat_variable = cat;
7+
return cat_variable;
78
}
89
console.log(returnCat());
910
/* console.log(inside_variable); */ //is not defined bercause the variable in within the function scope

0 commit comments

Comments
 (0)