1. Jonathan Fine
  2. javascript-for-python-programmers

Commits

jf3243  committed 41c63d8

Add function-exercises.js - 'parameters'.

  • Participants
  • Parent commits cc20307
  • Branches javascript-exercises

Comments (0)

Files changed (1)

File core-javascript/javascript-exercises/answers/function-exercises.js

View file
     something = undefined;
     assert( fn_2() === 42 );
 });
+
+
+TEST('parameters', function()
+{
+    var something = null;
+
+    var fn = function(a, b, c){
+        // start
+        return b;
+        // stop
+    };
+
+    assert( fn(1, 2, 3) === 2 );
+    assert( fn(4, 5, 6) === 5 );
+
+    something = 8;
+    assert( fn(7, 8) === something );
+
+    something = 10;
+    assert( fn(9, 10, 11, 12) === something );
+
+    something = undefined;
+    assert( fn(13) === something );
+
+    something = undefined;
+    assert( fn() === something );
+});