Advertisement
Guest User

Switch case in Javascript does not work properly

a guest
Apr 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. console.log('['+DETAILS[6]+']');
  2. switch (DETAILS[6]) {
  3. case 'TERMINE' :
  4.     CLASSE='statut_ok';
  5.     console.log('TERMINE => '+CLASSE);
  6. break;
  7. case 'EXECUTION_EN_COURS' :
  8.     CLASSE='statut_wa';
  9.     console.log('EXECUTION_EN_COURS => '+CLASSE);
  10. break;
  11. case 'undefined' :
  12.     PARAMS[4]='-1';
  13.     CLASSE='statut_no';
  14.     console.log('undefined => '+CLASSE);
  15. break;
  16. default :
  17.     PARAMS[4]=(parseInt(PARAMS[4])+1).toString();
  18.     CLASSE='statut_ko';
  19.     console.log('default => '+CLASSE);
  20. break;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement