Test case details

Preparation Code

<script>   var objDictionary = {     'a' : "The string is for case 'a'",     'b' : "The string is for case 'b'",     'c' : "The string is for case 'c'",     'd' : "The string is for case 'd'",     'e' : "The string is for case 'e'",     'f' : "The string is for case 'f'",     'g' : "The string is for case 'g'",     'h' : "The string is for case 'h'",     'i' : "The string is for case 'i'",     'j' : "The string is for case 'j'"   } </script>

Test cases

Test #1

strValue = objDictionary['j'];  

Test #2

strKey = 'j'; switch( strKey ) {   case 'a' :     strResult = "The string is for case 'a'";     break;       case 'b' :     strResult = "The string is for case 'b'";     break;       case 'c' :     strResult = "The string is for case 'c'";     break;       case 'd' :     strResult = "The string is for case 'd'";     break;       case 'e' :     strResult = "The string is for case 'e'";     break;       case 'f' :     strResult = "The string is for case 'f'";     break;       case 'g' :     strResult = "The string is for case 'g'";     break;       case 'h' :     strResult = "The string is for case 'h'";     break;       case 'i' :     strResult = "The string is for case 'i'";     break;       case 'j' :     strResult = "The string is for case 'j'";     break; }

Test #3

strKey = 'j'; if(strKey == 'a') {     strResult == "The string is for case 'a'"; } else if(strKey == 'b') {       strResult = "The string is for case 'b'"; } else if(strKey == 'c') {       strResult = "The string is for case 'c'"; } else if(strKey == 'd') {       strResult = "The string is for case 'd'"; } else if(strKey == 'e') {       strResult = "The string is for case 'e'"; } else if(strKey == 'f') {       strResult = "The string is for case 'f'"; } else if(strKey == 'g') {       strResult = "The string is for case 'g'"; } else if(strKey == 'h') {       strResult = "The string is for case 'h'"; } else if(strKey == 'i') {       strResult = "The string is for case 'i'"; } else if(strKey == 'j') {       strResult = "The string is for case 'j'"; }