showing results for - "siwtch case javascript"
Maellys
17 Jun 2017
1const expr = 'Papayas';
2switch (expr) {
3  case 'Oranges':
4    console.log('Oranges are $0.59 a pound.');
5    break;
6  case 'Mangoes':
7  case 'Papayas':
8    console.log('Mangoes and papayas are $2.79 a pound.');
9    // expected output: "Mangoes and papayas are $2.79 a pound."
10    break;
11  default:
12    console.log(`Sorry, we are out of ${expr}.`);
13}