Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

siwtch case javascript

const expr = 'Papayas';
switch (expr) {
  case 'Oranges':
    console.log('Oranges are $0.59 a pound.');
    break;
  case 'Mangoes':
  case 'Papayas':
    console.log('Mangoes and papayas are $2.79 a pound.');
    // expected output: "Mangoes and papayas are $2.79 a pound."
    break;
  default:
    console.log(`Sorry, we are out of ${expr}.`);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: webpack setup proxy manual 
Javascript :: javascript on uncaught exception 
Javascript :: new variable in loop javascript 
Javascript :: get minutes and seconds from seconds in js 
Javascript :: javascript splice 
Javascript :: not disabled jquery 
Javascript :: stopping setinterval 
Javascript :: print whole array javascript 
Javascript :: js mb to bytes 
Javascript :: dynamic calendar in javascript with example 
Javascript :: js count char frequency in string 
Javascript :: object literal javascript 
Javascript :: ref in mongoose example 
Javascript :: get n random items from array javascript 
Javascript :: JavaScript string encryption and decryption 
Javascript :: ajax mdn 
Javascript :: atob javascript 
Javascript :: react-native-infinite-scroll-with-flatlist 
Javascript :: queryselector javascript 
Javascript :: jquery filter data 
Javascript :: express url redirect 
Javascript :: moment.js 
Javascript :: mobile number validation in javascript with country code 
Javascript :: how to crash with js 
Javascript :: draw border on canvas 
Javascript :: append after div 
Javascript :: get results from db and put in javascript array codeigniter 
Javascript :: Validate email or phone number javascript 
Javascript :: jszip create zip file 
Javascript :: define a class in javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =