Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
const food = "apple"
switch(food) {
  case 'pear':
    console.log("I like pears")
    break
  case 'apple':
  case 'oranges':
    console.log("I like apples & oranges")
    break
  case 'grapes':
    console.log("I like grapes")
    break
  default:
    console.log("Your fruit selection is weak :(")
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x