fix(learn): add example declaration for clarity (#40207)

Variable declaration is added which is used inside the switch case.
This commit is contained in:
rajapandi_vijayakumar
2020-11-09 22:39:21 +05:30
committed by GitHub
parent 15b44b9bcb
commit e8b6a9e5dd

View File

@ -11,6 +11,7 @@ forumTopicId: 18242
If the <code>break</code> statement is omitted from a <code>switch</code> statement's <code>case</code>, the following <code>case</code> statement(s) are executed until a <code>break</code> is encountered. If you have multiple inputs with the same output, you can represent them in a <code>switch</code> statement like this: If the <code>break</code> statement is omitted from a <code>switch</code> statement's <code>case</code>, the following <code>case</code> statement(s) are executed until a <code>break</code> is encountered. If you have multiple inputs with the same output, you can represent them in a <code>switch</code> statement like this:
```js ```js
var result = "";
switch(val) { switch(val) {
case 1: case 1:
case 2: case 2: