We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dea335 commit 6aee20eCopy full SHA for 6aee20e
5-advanced-JS/starter/script.js
@@ -150,7 +150,21 @@
150
// }
151
// game();
152
153
-(function(goodluck){
154
- var score = Math.random() * 10;
155
- console.log(score >= 5 - goodluck);
156
-})(5);
+// (function(goodluck){
+// var score = Math.random() * 10;
+// console.log(score >= 5 - goodluck);
+// })(5);
157
+
158
+//Closures
159
+function retirement(retirementAge) {
160
+ var a = ' years left until retirement';
161
+ return function(yearOfBirth){
162
+ var age = 2016 - yearOfBirth;
163
+ console.log((retirementAge - age) + a);
164
+ }
165
+}
166
167
+// var retirementUS = retirement(66);
168
+// retirementUS(1990);
169
170
+retirement(66)(1990);
0 commit comments