I’m trying to use Javascript to validate an input field to have the specific formatting below: “WORD1,WORD2” So there has to be a comma in between two words, no spaces. WORD1 can be any word, but WORD2 has to be a word from the following list: “USD”, “AUD”, “BTC…
How to make an input required based on the value of another input?
I have two HTML form fields in my application, one displays a dropdown for users to select if they are over 18 and the second field is for parent’s name. I want to make the parent_name field required only if the user is under 18. Here’s my current code for the appropriate form parts. I’ve cr…
Set a range to uppercase in sheets APP SCRIPT
I want to create a script that I will have in a menu that gets the range “A1:C” and uppercases it. The problem is that throws an error “TypeError: values.toUpperCase is not a function” trying to use toUpperCase(). Got the following code: Im pretty new to JS and sheets api. I feel dumb …
Javascript: How to populate arguments passed to a function?
I have this code that returns cartesian product of three arrays: For example, like this: However, I don’t always want my number series to be made out of three numbers. Sometimes, I want four, five, or any other number. That is why I would like to have an argument that would populate the arguments inside…
Is is possible to use an typescript Union type for the state of a Redux Toolkit Slice?
I’d like to use an union type like this to represent my slice’s state when using Redux Toolkit: It seems like the usage of Immerjs in the reducer files prevents me from switching between the two Union options, e.g.: Which gives me the following Typescript error: Is there any way to make this work?…
Reading multiple objects, in a single object, with in an array, with unique keys. into FlatList
I am trying to display this data in a FlatList. My data looks like this, its multiple objects in a single object within an array, and each object has multiple unique Ids how can I read the data. My FlatList code Here the problem is, FlatList is considering the main object and not the children, how can I acces…
I’m trying to understand how to make 2 classes hover at same time
Hello there, I am trying to create a simple CSS animation as you can see in my code. However, I can’t understand how to execute both hovers once the user hovers over the external div. Is this possible with raw CSS or JS is needed? Thanks Answer You can select the .outer:hover and .outer:hover .inner so …
compare 2 arrays and get key of one with value of the other one in React [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 months ago. The community is reviewing whether to reopen this question as of last month. Improve this question So in React, I…
– Write a function called sumNumbers that accepts a single array of numbers and returns the sum of the numbers in the array [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 10 months ago. Improve this question I’m really new to JavaScript, So excuse me if this question might seem a little unde…
Get numbers of difference in two strings javascript
i have two string I want to find diff in these two string for example in this scenario it is 2 Answer I’m presuming the strings need to be compared based on the comma separations, but to be fair there isn’t enough details in the question… Split the strings by comma Apply the above function t…