Posts by PiviaN • 91 points
9 posts
-
-3
votes2
answers26
viewsQ: Join Mysql Tables with similar field names
I have the following tables: client : id_client, name, surname, birth date house : id_casa, house, fk_cliente, fk_bairro car : id_car, model, fk_customer neighborhood: id_bairro, name I want to…
-
1
votes2
answers74
viewsQ: How to reduce the amount of If’s in a simultaneous redirect?
I have a function called redirectToNextPage that does the following: Takes the value of the URL from the previous page and, after three seconds, redirects to the next page, using an IF for each URL,…
javascriptasked PiviaN 91 -
0
votes1
answer27
viewsQ: useEffect does not work when trying to transform Stateful component into Stateless
I have a component that was class-based, and I’m now passing it on to be function-based. The only problem I’m having is that, before, I used the component DidMount() to start the component with some…
-
1
votes1
answer92
viewsQ: Show current date in a particular Timezone
I am trying to put on my site the local time of another city, through the data.timezone returned by the Open Weather API. This value is in seconds, for example, if the country has an extra 3 hours…
-
1
votes2
answers75
viewsQ: Concatenate two arrays according to their respective indices
I have two arrays, the first being [a, c, e, g] and the second [b, d, f, h], for example. I want to concatenate these two arrays into a respective order, forming: [ab, cd, Ef, Gh] instead of the…
-
3
votes1
answer34
viewsQ: Transform 3 similar functions into one
In my project, I have very similar functions, with the same intention, however, as it is a DOM class exchange function (classList.replace), I ended up making a very repetitive code, and I’d like to…
-
-2
votes2
answers59
viewsQ: Apply equal properties to different JS objects
I would like to know how do I encapsulate identical properties that are being assigned to different objects. For example: In my code, there is a 'first' object, which is located inside a class, and…
-
0
votes1
answer53
viewsQ: How do I perform a setTimeout after another setTimeout?
I have the following code inside my script: (Function() { 'use Strict'; let $leftside_div = document.querySelector('.leftside-div'); let $centerside_div = document.querySelector('.centerside-div');…
-
-2
votes1
answer54
viewsQ: Import and Export does not even work with type="module"
I have a Javascript file called "redirect.js", in which it has only two similar functions, which serve only to redirect to a specific page, "redirect.js", containing the following code: export…