I´m stuck at this feedback part


#1


Can someone help me with this part? It says there is an error with your syntax, if i remove the part where the VAR feedback starts the code works, i cant find anything wrong.. 
This is my code: 

confirm("I am ready to play!");
var age = prompt("what's your age?");
if (age >= 13) {
console.log("You can play :)!");
} 
else 
{
console.log("you can't play :(!");
}

    console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
    console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Bieber on stage?");
    if (userAnswer === "yes") {
        console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
    }
    else {
        console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
    }
    
var feedback = prompt("Please rate this experience!");

if (feedback === > 8) {
    console.log("Thank you! We should race at the next concert!") }
    else { console.log("I'll keep practicing coding and racing.")
}


#2

nodejs:

[stdin]:23
if (feedback === > 8) {
                 ^
SyntaxError: Unexpected token >

#3

What do you mean by this?


#4

Same syntax error, but it includes the location


#5

dang it, i can´t find why it´s not working. Is it in the wrong place? is there something wrong with the 3 ='s? is it >8 or > 8


#6

What is 8 supposed to be greater/less than?

Ask yourself what that line is supposed to do


#7

supossed to a 10.. if the feedback is greater than an 8.. than console.log("...... but then if its less than console.log(".....

am i supposed to make a statement on if its less than with the else value?


#8

> checks the value on the left side and the one on the right side. On the right side you have an 8, on the left there's nothing, you're not comparing 8 to anything


#9

Sorry for being a noob, but it´s supposed to say that if the feedback is greater than an 8 it will log something in the console,

else.. it will log the other comment in the console, i cant find anything wrong with the code. The code that asks the user if he is 13 or above works perfectly fine and i tried to copy it into the feedback part.. but it doesn't work.


#10

There need to be values immediately to the left and right of the operator. There's no expression on the left side.

VALUE1 > VALUE2

If you instead do:

> VALUE

Then .. there's a > without a value on the left side first and that isn't valid syntax

=== also expects a value on each side, meaning that:
(feedback === (> 8))
There has to be an expression on each side of it
But then again, what is that operator doing there? Make sure you only write what really needs to be there, if you've got random operators in-between other code then that is going to change the meaning or have no meaning


#11

I'm sorry, i can't figure out what the code must be.. the code at the var age works perfectly fine and there where no differences in my code at var feedback. If i took away the code at the bottom the code works..


#12

What does each part do here, what's the purpose, how should it be interpreted?

5 === > 8

What would the result be?

You wrote something like that, so you must have some intention for it. I'm not convinced you've thought it through though.

How many comparisons are supposed to happen there? How many comparison operators are there? Do all the operators have a value on each side of it?


#13

i get it now.. the example you gave me would turn in false..

1 = is for a task
3 of them is to see if something is true or false..

Thank you for not immediately giving me the anwser :slight_smile: Great help!

The code works now.


#14

Absolutely not! It makes no sense, there is no result. It's not valid syntax.
If you're testing whether one thing is greater than another, then what would the equals operator be doing in that expression? And if there are two operators each requiring a number on either side, then 4 values would be required, or 3 if the result is re-used


#15

I'm still confused by this even after reading these comments, what did your finished code look like as mine is still struggling?


#16

i did this
(if feedback=prompt>=8)
{console.log("Thank you! We should race at the next concert!")}
else{console.log("I'll keep practicing coding and racing.")}

I Hope this helps


#17

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.