I started to take the first course , but in the end I ran into a problem that I can’t finish. What is the problem? What is wrong written?

var myName = "Ololoshechka"; if (myName.length === 12) { console.log("Первый курс завершён!"); } else { console.log("Не завершен"); } 

Here is the task itself:

Write your own if / else construct. The result of the condition check should be the display of the phrase "First course completed!".

  • Yes, and indeed a great lesson. - Costantino Rupert
  • Those. I wrote everything correctly? - Syasaa
  • @Syakaa Well, in general, it is not very difficult here :) - Costantino Rupert
  • one
    @ Kotik_khohet_kushat, but oh well ...)) A person learns. @Syaqaa, if it doesn’t work, then the condition of the problem is probably misunderstood. I would have looked, but only something bummer me to pass the whole course;) - Deonis
  • one
    We were intrigued, but you don’t want to throw a reference to the task. Want to make a streak through all the circles "Hello, Word!" pass the? )) - Deonis


4 answers 4

Everything is correctly written, and the if else construction works.

alt text

    So everything works. Perhaps the “screen” output is the display of a modal window - then use alert instead of console.log .

      Most likely - the output to the screen is:

       document.write("Первый курс завершён!"); 

      Or

       document.writeln("Первый курс завершён!"); 
      • Does not fit. As I understand it, this is something like an essay. Question on the material covered. There was only an alert (not suitable) and console.log - Syasaa

      if (myName.length === 12) should be "==", and not "===" I’m not going to java at all, but in Sharp it would be

      • one
        > I'm not at all a java. Maybe it was worth starting with? - Specter
      • In js there is such an operator as strict equality . - beardog
      • I advise you to learn c # at least the basics for a start, and then talk - johniek_comp