Posts by lucas F • 455 points
12 posts
-
0
votes0
answers25
viewsQ: How to receive the event object next to the props of a component in a React function?
Given a call from event onSubmit in any form that activates a function, how can I receive the event object along with other properties? demonstration: const handleSubmit = async ( // OBJETO DE…
-
1
votes1
answer36
viewsQ: How to check the type of a unit test value using Jest?
I have a function that returns an object with two properties: name and id, where name will receive its value per parameter and id is generated automatically by Date.now(). My goal is to create a…
-
1
votes0
answers21
viewsQ: How to manage the prop "disabled" of a multi step form buttons with Formik?
The Formik provides a call prop isValid, which already solves the problem of defining when the form button should be disabled. The problem is that this apparent does not work in a multi step form,…
-
-1
votes1
answer364
viewsQ: how to resolve Git public key permission error within VSCODE
My vscode does not allow you to exchange data between Git and Github (push, pull and Sync), and this only happens when I use the vscode tools (when I open the "Ctrl shift p" search bar, or when I…
-
0
votes0
answers17
viewsQ: how to create an alias in Git for the "log --Pretty=oneline" command
As the title says, I need to create an alias for the "log Pretty=oneline command". I know of the existence of the advanced syntax of bash to do this, but I can’t learn it at the moment, for now I…
-
6
votes1
answer44
viewsQ: What exactly does Rest syntax return, just the elements or some special object?
Doing some exercises, I realized that it is possible to use the map function in a Rest that apparently only returns pure elements. also realized that it is not possible to apply a typeof nor…
-
2
votes2
answers541
viewsQ: Bold words from my HTML using Regex
Basically, I need to select all the words "Pattern" in my HTML with Regex and then replace them with your version in bold through Javascript. My code works, however, only for the first element, for…
-
0
votes0
answers87
viewsQ: I cannot add element to DOM through an anonymous function in JS
I created a table via javascript by manipulating elements of an array, which is all right, but I can only add the table in the DOM by a common function or an anonymous Jquery function, but when the…
-
4
votes1
answer401
viewsQ: how to change the display of div by js?
For some reason that I do not know this time the browser does not want to render the code... basically I need to change the display: nome of div for display: blockthrough javascript. botaoSticky =…
-
5
votes2
answers298
viewsQ: How to overlay flex items during a CSS Hover?
I have a form you received display: flex, and inside it is 3 inputs: a name, a password and a button, plus a h1 written 'login'. When I pass the mouse over the elements, the height and the width…
-
-1
votes2
answers1013
viewsQ: Filter an Array of names and return the larger(s) name(s)
I have an object JSON of a form, then converted normally and created a map only with the names of users within a array. The next step I need to take is to analyze all the names and get the(s) that…
javascriptasked lucas F 455 -
15
votes3
answers356
viewsQ: Why is it possible to change an array or object value from within a constant?
const array = ["a", "b", "c", "d"]; array[1] = 2; console.log(array); //- ['a',2,'c','d'] In this example I gave, I changed the value of the constant dynamically, too, it is possible to do the same…