diff --git a/ch00/test.js b/ch00/test.js new file mode 100644 index 0000000..ef7d746 --- /dev/null +++ b/ch00/test.js @@ -0,0 +1,6 @@ +let uniqueInteger = (function () { // Define and invoke + let counter = 0; // Private state of function below + return function() { return counter++; }; +}()); +console.log(uniqueInteger()) // => 0 +console.log(uniqueInteger()) // => 1 \ No newline at end of file