#How can I remove "undefined"?

10 messages · Page 1 of 1 (latest)

wicked nymph
#

I'm not sure how to do this, I tried string.replace() and regex but it's not really helped, can someone guide me please? I'm playing around with turbo model and gpt-3's Da Vinci 003.

#

How can I remove "undefined"?

frosty tide
#

How does the code look that prints the response?

wicked nymph
#

I'm not sure about what can be changed in the code, do you spot a mistake here? @frosty tide

frosty tide
#

resultRef.current is, on the first "message" event, undefined. And something undefined plus a string is "undefinedplusastring". Lastly I'm guessing that the text variable (at line 90) might also be undefined in the last message event.

#

So initially set resultRef.current to an empty string, before you rend the API request 🙂

The tailing "undefined" is not entirely clear to me.

wicked nymph
#

This is wrong?

frosty tide
#

Unsure 🤷‍♂️ my React is not strong. I do very well with general Javascript though 🙂

wicked nymph