Skip to content

Commit 1785325

Browse files
Added some commentary.
1 parent fdb8cd1 commit 1785325

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

digit_name.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// The outer function executes immediately, and it returns the inner function.
2+
// The inner function is a closure, and retains access to the names array for
3+
// as long as digit_names has scope.
14
var digit_name = function () {
25
var names = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
36

0 commit comments

Comments
 (0)