for example, a very small snippet from a library of mine (not js, but rust): send_method::<bool, C>( self.client, &self.token, "answerInlineQuery", None, ...
also, findNumber != true will return false if findNumber is 1. first, use !==, second, why not return null if you couldn't find the value?
your async function desugars into something like: enum DoHeavyWork { Start, Ready, } impl Future for DoHeavyWork { fn poll(..) -> Poll<()> { loop { match sel...
form doesn't seem to be defined in this code, what is its value? it would also be great if you show the markup so one can test your code easier (btw, on line 11, k != 0 || k ...
can you show the whole component's code? looks like you do something not in the react way
node makes an asynchronous call to read the file, remembers to call a callback when reading is done, and continues to execute the current stack. When node is idle, it waits fo...
it may took a reasonably long time to find the explanation of the problem in your history, and even if you try to find something related to the problem in your history, it's b...
so you first tried to map an array (problem X), then decided you could solve your problem using a function and don't know how to solve it either (problem Y)? really, just map...
the as operator only tells typescript "trust me, this value is of this type", it doesn't affect runtime. you can destructure the object: const { first_name: firstName } = req....
first, make sure that the rt-threaded feature in tokio is enabled. then, as currently written, do_heavy_task is blocking and async doesn't change this fact. is it actually goi...
explaining why a function exists and how could you make use of it? that's fine for documentation. but for something like this: if (...) { // if the condition is met, we nee...
why not this? const XO = (str) => { const count = [...str.toLowerCase()] // .filter(l => l == "o" || l == "x") .reduce((obj, l) => { obj[l]++;...
where do you define getDay?
so did you name the variable containing the request res(ponse) and the variable containing the response req(uest)?
why use it over plain comments? especially since this is language-specific, and, for example, rust, which has doc comments built into the language, will emit a warning during ...
no? searching the whole mdn for this attribute only points to <area>, for which the attribute is obsolete. the spec also doesn't say anything about it, but you can see an exam...
i have never seen code using doc comments to explain the code instead of documenting functions/classes/etc, but when i saw comments explaining something, those were simply pla...
what is _?
again, this if block is written just terribly. if (foo) { return bar; } return baz; or even return foo ? bar : baz is much better code
probably you don't change position on the button? by the way, don't use links to make a button, there's <button type="button"> for that