I write a js code to determine which number is bigger but the result is not perfect! when I input two number with same digit numbers, the result is correct. For example when I input “2” and “3” the result is “3” but when I input “2” in first field and “55&…
Category: Questions
Why does it print “undefined” on the console? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. This post was edited and sub…
How to avoid re rendering text input?
I have a TextInput and I don’t want it to re render every time I change the value inside it but I want to be able to change the value inside the input at the push of a button that’s why I haven’t just used defaultValue any solutions?? Answer You can use useRef to save text from text input wi…
Validating not required form fields with Yup?
I want to validate a not required form field with Yup lastname: Yup.string.nullable().notRequired(). I don’t how to proceed further because I have multiple condition to validate the field if the input was given. My validation condition are: Should contain only alphabets. Should be atleast minimum 2 and …
How to convert Moment.js moment to unix timestamp
I see a lot in the Moment.js documentation about getting a Moment from a Unix timestamp. However, I am trying to convert a Moment to a Unix timestamp, and I am not sure how to do that. This is how my moment looks: const myMomentObject = moment(str_time, ‘YYYY-MM-DD’); And I need to convert it to a…
need to get the count of values inside the a JSON object -java script
my output should be Answer
FirebaseError: Expected type ‘Tc’, but it was: a custom Ac object
I’m trying to access all documents from my firestore collection but it’s throwing this err FirebaseError: Expected type ‘Tc’, but it was: a custom Ac object Answer The getDoc() method is used to get a single document and takes a DocumentReference as a parameter. Here todoRef is a Colle…
How to take the input from a react component and pass the length of the input to another react component
I have a textarea where I want to have an onChange event. When text is entered, I want to compute the length of the string entered and then pass it to another react component to display the character count. However, I’m having trouble passing the data into my react component. I have 3 react components i…
Can you use the value of a variable to select an already defined variable with that same name?
I’m trying to try something out for my AP statistics class where I need to randomly select five words from the lyrics of a song and calculate the average length of those strings. This is what I have so far: (There’s 297 lyrics but I don’t want to type all of those out if it won’t work)…
Cannot connect to database stored on aws from Heroku or Replit websites. (mysql2, node.js)
Problem: My discord.js bot isn’t connecting to the mysql database on aws. The bot is being hosted on replit and also on heroku but for some reason I can’t connect to both. I have tried connecting to the database from my laptop and it worked fine, I even hosted the bot on my laptop to see if there …