title: Wrong switch case syntax but works on all browser except Safari
body: <p>Here's an example of what I meant</p>
  
  <pre><code>switch(fruits) {
      case fruits = "Banana":
          text = "Banana is good!";
      break;
      case fruits = "Orange":
      text = "I am not a fan of orange.";
      break;
      case fruits = "Apple":
      text = "How you like them apples?";
      break;
      default:
      text = "I have never heard of that fruit...";
  }
  </code></pre>
  
  <p>Notice that the case syntax doesn't follow <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch" rel="nofollow noreferrer">official guideline</a></p>
  
  <p>And it doesn't get any sort of warning in VSCode</p>
  
  <p>The odd thing is, and something I hope someone would be able to answer me is: <strong>Why does this code still works on all browsers except Safari?</strong> And there's an additional interesting thing that happens in Safari as you can see below</p>
  
  <hr>
  
  <p>This is how it works in <strong>Chrome</strong>
  <img src="https://res.cloudinary.com/omar2017/image/upload/v1530081747/Chrome_copy_uew79u.gif" alt="chrome copy"></p>
  
  <hr>
  
  <p>This is how it works in <strong>Safari</strong>
  <img src="https://res.cloudinary.com/omar2017/image/upload/v1530081745/Safari_copy_jbqxtp.gif" alt="safari copy"></p>
  
  <hr>
  
  <p>And here's the weird part, if I turn on <strong>Safari Web Inspector</strong>, it works, but turn it off and it stops working
  <img src="https://res.cloudinary.com/omar2017/image/upload/v1530081747/Safari_WebInspector_copy_gbanei.gif" alt="safari webinspector copy"></p>
  
  <hr>
  
  <p>So what's the reason this happens?</p>
  
  <p>And here's a <a href="https://jsfiddle.net/xL742bfe/2/" rel="nofollow noreferrer">JSFiddle</a> for those who want to see the code in action yourself. Thanks, <a href="https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_state_switch1" rel="nofollow noreferrer">w3 Schools for the sample code</a></p>
  
  <hr>
  
  <p><strong>EDIT:</strong>
  I am aware that the correct code is as follow, so to repeat the question, why does the above code still works on all browser except Safari when technically it should not work at all</p>
  
  <pre><code>switch(fruits) {
      case "Banana":
          text = "Banana is good!";
      break;
      case "Orange":
      text = "I am not a fan of orange.";
      break;
      case "Apple":
      text = "How you like them apples?";
      break;
      default:
      text = "I have never heard of that fruit...";
  }
  </code></pre>