Jump to content

POWERED BY:

Recommended Posts

 sabem me dizer pq o switch case nao ta funcionando?
obrigado desde já
var dia = new Date();
    var diasem = dia.getDay;
    console.log(diasem);
    switch (diasem) {
        case 0:
        console.log = ("Domingo");
        break;
        case 1:
        console.log = ("Segunda");
        break;
        case 2:
        console.log = ("Terça");
        break;
        case 3:
        console.log = ("Quarta");
        break;
        case 4:
        console.log = ("Quinta");
        break;
        case 5:
        console.log = ('Sexta');
        break;
        case 6:
        console.log = ("Sabado");
        break;
        default:
        console.log("[ERRO] Numero invalido");
        break;
    }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.