What will be the output of the following JavaScript code? [code] var grade='A'; var result; switch(grade) { case 'A':

Thanh Hoan

New member
What will be the output of the following JavaScript code?
Code:
var grade='A';  
var result;  
switch(grade)
{  
    case 'A':  
        result+="10";  
    case 'B':  
        result+=" 9";  
    case 'C':  
        result+=" 8";  
    default:  
        result+=" 0";  
}  
document.write(result);
A. 10
B. 27
C. 8
D. 0
 

Tìm kiếm

Back
Top