Skip to content

Commit 10fa229

Browse files
author
Sascha
committed
finished goals by answering closure.js
1 parent 4d86b4e commit 10fa229

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎assignments/closure.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// ==== Challenge 1: Write your own closure ====
22
// Write a simple closure of your own creation. Keep it simple!
3-
3+
const cat = 'kittie';
4+
function returnCat () {
5+
let inside_variable = 'so much private';
6+
return cat;
7+
}
8+
console.log(returnCat());
9+
/* console.log(inside_variable); */ //is not defined bercause the variable in within the function scope
410

511
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
612

0 commit comments

Comments
 (0)