R
Reactiflux

help-js

bfrisco – 00-42 Jan 1

BBrice1/1/2023
Is there a purpose of what I am dubbing as "blanket brackets" within functions? Example:
await socket.connect({host, port, timeout: 5000});
{ // <--- what is this?
socket.writeVarInt(0x00);
socket.writeVarInt(50);
// ...
}

let response;
// ...
await socket.connect({host, port, timeout: 5000});
{ // <--- what is this?
socket.writeVarInt(0x00);
socket.writeVarInt(50);
// ...
}

let response;
// ...
I've seen this a couple times in open source repos, wondering if that's just an oversight or if this actually does something.
UUUnknown User1/1/2023
2 Messages Not Public
Sign In & Join Server To View
BBrice1/1/2023
If no variables are defined inside of it, is it just meaningless then?
UUUnknown User1/1/2023
Message Not Public
Sign In & Join Server To View
BBrice1/1/2023
From a functional standpoint Ok, thanks Ah okay, I do see comments on top of each now. It must just be a visual thing like you said. Nice to know about the variable scoping though.
UUUnknown User1/1/2023
2 Messages Not Public
Sign In & Join Server To View
BBrice1/1/2023
In this case it makes a lot of sense (writing packets)
UUUnknown User1/1/2023
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
✅ – Sorrow – 21-59 Dec 30Hi, I'm following this tutorial (https://reactjs.org/tutorial/tutorial.html#showing-the-past-moves) Box Element causing overflows on smaller screens, even though it does not reach the end of screenI am using Material UI with React and Webpack On smaller screens my react box component makes the sc✅ – _mercury – 21-33 Dec 30I had many instances of divs that each contains an input they are generated dynamically I want ant✅ – Script – 23-31 Dec 29how can I conditionally render `checked` in this radio input `<input type="radio" checked />`Alex. – 09-19 Dec 29I need to replace the url using regex, current url : `http://localhost:3000/#/test/id/123456&gid=1&pNext-steps scaling up and expandingHey guys, so I wanted your opinion and seek some guidance on how to proceed with this *issue* For so✅ – mzeeshan – 14-02 Dec 28hello there..... RegExp Question.... i'm beginner in RegExp. i have a variable `search` that contaiCannot display table using ReactHi, I am trying to display a simple table but it is showing me error. Been stuck on this for two we✅ – Perke – 18-27 Dec 26For every 13 objects id like to get an object like {size: "7", asks: [200,220,250]} so basically siz✅ – _mercury – 21-58 Dec 25what could by the reason that this func sends 2 reqs ? ```js async saveProduct(cartoon) { mzeeshan – 18-54 Dec 25hello there... Question..... what is the meaning of `line 4` , i mean why there is `, e` .......? ``✅ – Cooly – 23-00 Dec 24```js await ref.recipes.forEach(async(doc) => { await firebase.firestore().collection("recipes").doc