Merge pull request #7751 from michaelkro/feature/add-switch-link

Adds switch statement MDN link
This commit is contained in:
Mrugesh Mohapatra
2016-03-28 03:21:38 +05:30
2 changed files with 6 additions and 0 deletions

View File

@@ -79,6 +79,9 @@ var links = {
"Array.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
"Array.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
// ======== STATEMENTS AND DECLARATIONS
"Switch Statement": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch",
// ======== MATH METHODS
"Math.max()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
"Math.min()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",

View File

@@ -3446,6 +3446,9 @@
"solutions": [
"function myTest(val) {\n var answer = \"\";\n\n switch (val) {\n case 1:\n answer = \"alpha\";\n break;\n case 2:\n answer = \"beta\";\n break;\n case 3:\n answer = \"gamma\";\n break;\n case 4:\n answer = \"delta\";\n }\n return answer; \n}"
],
"MDNlinks": [
"Switch Statement"
],
"tests": [
"assert(myTest(1) === \"alpha\", 'message: <code>myTest(1) should have a value of \"alpha\"');",
"assert(myTest(2) === \"beta\", 'message: <code>myTest(2) should have a value of \"beta\"');",