switch-case example
Print the corresponding Chinese character status according to the status code of the order (use switch-case)
1-waiting for payment 2-waiting for delivery 3-in transit 4-signed for receipt 5-cancelled others-untraceable
var n='2' switch(n){ case 1: console.log( 'Pending payment' ); break ; case 2 : console.log( 'waiting to ship' ); break ; case 3 : console.log( 'in transit' ); break ; case 4 : console.log( 'Signed for' ); break ; case 5 : console.log( 'cancelled' ); break ; default : console.log( 'untraceable' ); }