Posts by Braga Us • 353 points
6 posts
-
13
votes2
answers246
viewsQ: What does "!!~" mean in Javascript?
I am studying Javascript and came across the following code: manageLag(selected) { if(!!~this.selections.indexOf(selected.url)) { selected.at += 5 return; } this.selections.push(selected.url) } I…
-
5
votes2
answers147
viewsQ: In Java because (250 >> 4) is more optimized than (250 / 16)
I’m taking a Java course and in a class the teacher said that this code: int xstart = Camera.x >> 4; int ystart = Camera.y >> 4; is more "fast or optimized" than this code: int xstart =…
-
2
votes1
answer347
viewsQ: How to upload files with Multer to two different storages?
Good evening, I need to upload a file to a local folder (where it will be treated to compress the file) and to Storage S3. S3 configuration and local multer storage is programmed and both work…
-
0
votes2
answers164
viewsA: how to accept null or empty field with Celebrate js middleware
I managed to solve with the following code: ... desc: Joi.string().allow(null, '').max(500), ...
-
-1
votes2
answers164
viewsQ: how to accept null or empty field with Celebrate js middleware
Good morning, I am validating the data on a backend route and need a null or empty accepted field, so I used the following code: // Rota para postar arte individual router.post('/postarArte',…
-
4
votes1
answer63
viewsQ: Yup Mixed does not work notRequired or nullable
Good afternoon, I am validating the data of a form with Yup and need that only images can be loaded, so I used the following code: // formato que pode ser upado no input de email const…