Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
Whenever my code runs it just comes up as "javascript"
<!DOCTYPE html>

<html>

<head>

<style>




</style>

</head>

<body>

<script>
//variables//
var x = Math.floor((Math.random() * 5) + 1);
var y;

//variable y//
if (x = 1) {
    y = 'javascript';
} else if (x = 2) {
    y = 'html';
} else if (x = 3) {
    y = 'python';
} else if (x = 4) {
    y = 'swedish';
} else if (x = 5) {
    y = 'your choice';
} else {
    y = 'error';
} 
//what should be printed//
document.write('<h3>' + y + '</h3>');
</script>

</body>

I'm trying to make some javascript code that decides what I am going to focus on for the day but it just comes up as "javascript" whenever I try to load it. I could have a bit of code in the wrong or some invalid syntax, I'm not entirely sure what could be wrong because I'm pretty new to javascript.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda