File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,20 @@ describe("About Functions", function() {
3939 } ) ;
4040
4141 it ( "should use lexical scoping to synthesise functions" , function ( ) {
42-
43- function makeIncreaseByFunction ( increaseByAmount ) {
44- var increaseByFunction = function increaseBy ( numberToIncrease ) {
45- return numberToIncrease + increaseByAmount ;
42+
43+ function makeMysteryFunction ( makerValue )
44+ {
45+ var newFunction = function doMysteriousThing ( param )
46+ {
47+ return makerValue + param ;
4648 } ;
47- return increaseByFunction ;
49+ return newFunction ;
4850 }
49-
50- var increaseBy3 = makeIncreaseByFunction ( 3 ) ;
51- var increaseBy5 = makeIncreaseByFunction ( 5 ) ;
52-
53- expect ( increaseBy3 ( 10 ) + increaseBy5 ( 10 ) ) . toBe ( FILL_ME_IN ) ;
51+
52+ var mysteryFunction3 = makeMysteryFunction ( 3 ) ;
53+ var mysteryFunction5 = makeMysteryFunction ( 5 ) ;
54+
55+ expect ( mysteryFunction3 ( 10 ) + mysteryFunction5 ( 5 ) ) . toBe ( FILL_ME_IN ) ;
5456 } ) ;
5557
5658 it ( "should allow extra function arguments" , function ( ) {
You can’t perform that action at this time.
0 commit comments