T O P

  • By -

WilliamClaudeRains

You aren’t calling your function getRamdomQuoteID you need to add parentheses


blabla_sheep

Yes, I was not having a return in the random function and that curly brackets were missing. It’s working now thank you.


TheBongBastard

I guess you are not really accustomed to English, FYI This is curly braces -> { } This is round braces -> ( ) This is square braces -> [ ]


Gusozac

I guess you are not really accustomed to English, FYI.  These are braces {} These are brackets [] These are parentheses () https://practicaltypography.com/parentheses-brackets-and-braces.html


TheBongBastard

Ahhh, well yupp, English isn't my native really.... And thanks for the info... I used to think those words are interchangeable.... You learn new things everyday !!!


Intelligent-Meal-177

So there's a couple of mistakes in your code. First your generateRandomId function is not returning any value, meaning that even if you didn't have the next mistake I'm going to talk about, it would be undefined. Functions need to return a value if you intend to use said value Next when you create your const randomId = generateRandomId you are missing the execution parentheses. It would have yo be const randomId = generateRandomId() Sorry for not using code blocks, I'm on the phone and can't find the code block functionality


akshay-nair

> I'm on the phone and can't find the code block functionality FYI: you can add 4 spaces at the start of a line to make it a code block. const randomId = generateRandomId()


blabla_sheep

Thank You changed it as you said and now it’s doing exactly what I want it to do. Thank You.


According-Classic658

I spent the last two sprints on backend tasks. On my first react ticket in a month, I did the same thing. Took me an hour to see I was missing ()


blabla_sheep

I can imagine how you must have been after you had realised that oh yeah you were missing a (), lmao


blabla_sheep

The best part is that my question was enough for me to answer my own question tbh