Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

266
Vistas
Can you highlight where I've gone wrong

I've been working on this for over 12 hours.

I really enjoy coding but I'm very bad at it.

Could you please highlight in red where I've gone wrong in this code?

(function (window) {
var names = {"Yaakov", "John", "Jen", "Jason", "Paul", "Frank", "Larry", "Paula", "Laura", "Jim"};
for (let i = 0; i < names.length; i++) {
if (firstLetter === 'j')  || 'J'{
    byeSpeaker.speak(names[i]);
  } else {
    helloSpeaker.speak(names[i]);
  } 
}

})(window);

(function (window) {

var speakWord = "Hello";

var helloSpeaker = speakWord;

helloSpeaker.speak(name) = fuction () 
    
(speakWord + " " + name);

window.helloSpeaker = helloSpeaker;
console.log(window);})

(function (window) {

var speakWord = "Good Bye";

var byeSpeaker = speakWord;

byeSpeaker.speak(name) = function () {
    
(speakWord + " " + name);}

window.byeSpeaker = byeSpeaker;

console.log(window);})
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Module 4 Solution Starter</title>
  <script src="SpeakHello.js"></script>
  <script src="SpeakGoodBye.js"></script>
  <script src="script.js"></script>
</head>
<body>
  <h1>Module 4 Solution Starter</h1>
</body>
</html>

It's supposed to loop for hello name but goodbye for names beginning with J.

If you can provide more feedback I would be grateful.

Thanks in advance.

Natasha

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Your first if statement is bad. It should be like this:

if (firstLetter === 'j' || firstLetter === 'J') {
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda