JS--switch 语句

说明:js中switch语句的语法风格

function convert(x){
    switch(x)
    {
        case "string":
            document.write("string");
            break;
        case "number":
            document.write("number");
            break;
        default:
            document.write("null");
            break;
    }
}
原文地址:https://www.cnblogs.com/JiangLe/p/5682678.html