aral, to javascript
@aral@mastodon.ar.al avatar

Just wrote a note about a little gotcha with default values for destructured properties of parameter objects in JavaScript that has gotten me a few times:

https://codeberg.org/aral/gists/src/branch/main/default-values-for-destructured-properties-of-parameter-objects-in-javascript.md

schizanon, to javascript
@schizanon@mas.to avatar

I'm sure there's some technical reason it can't be done, but I really want to be able to wrap destructured variables with functions.

instead of:

const { prop, otherProp } = object;  
const propAsNumber = parseInt(prop);  

I want to do:

const { parseInt(prop), otherProp } = object;  

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • osvaldo12
  • everett
  • Youngstown
  • khanakhh
  • slotface
  • rosin
  • thenastyranch
  • ngwrru68w68
  • Durango
  • JUstTest
  • normalnudes
  • ethstaker
  • GTA5RPClips
  • modclub
  • cisconetworking
  • mdbf
  • tacticalgear
  • cubers
  • provamag3
  • tester
  • anitta
  • Leos
  • lostlight
  • All magazines