irelephant [he/him]🍭@lemm.ee to Programmer Humor@programming.devEnglish · 3 个月前looks good to melemm.eeimagemessage-square43fedilinkarrow-up1737cross-posted to: programmerhumor@lemmy.ml
arrow-up1737imagelooks good to melemm.eeirelephant [he/him]🍭@lemm.ee to Programmer Humor@programming.devEnglish · 3 个月前message-square43fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareKaryoplasma@discuss.tchncs.delinkfedilinkarrow-up15·edit-23 个月前Starting with Java 21 (I think), they’ve introduced ignored variables, so you can now actually do this: try { operation(); } catch (Exception _) { // nice weather, eh? } Edit: forgot that this is about JS lel
minus-squarejubilationtcornpone@sh.itjust.workslinkfedilinkEnglisharrow-up8·3 个月前So basically the same as a discard in C#?
minus-squareKaryoplasma@discuss.tchncs.delinkfedilinkarrow-up2·edit-23 个月前Yeah, Python has it as well. I think the only real use of it is code readability since you declare that this variable will never be used.
Starting with Java 21 (I think), they’ve introduced ignored variables, so you can now actually do this:
try { operation(); } catch (Exception _) { // nice weather, eh? }
Edit: forgot that this is about JS lel
So basically the same as a discard in C#?
Yeah, Python has it as well. I think the only real use of it is code readability since you declare that this variable will never be used.
Same thing right?