#destructuring — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #destructuring, aggregated by home.social.
-
You Can Use Same Variable Name TWICE?!
🔥 NO WAY! Destructuring allows DUPLICATE variable names in the same statement! const {a, a} = obj is VALID JavaScript! Last one silently wins. ESLint doesn't catch this by default. Tag a dev who needs to see this!
#javascript #javascripttricks #codingchallenge #destructuring #javascriptes6 #javascriptquiz #javascriptweird #javascriptwtf #javascriptbugs #codinginterview #codingtips #javascriptshorts
-
Multiple Assignment Magic: Tuple vs Array Destructuring!
Python's tuple unpacking vs JavaScript destructuring - which is more powerful? INSANE!
#javascript #python #jsvspython #destructuring #tupleunpacking #multipleassignment #arraydestructuring #viralcoding #pythontricks #javascripttricks #syntaxcomparison #mindblown
-
How to Stop Destructuring From Crashing on null
Destructuring null throws instantly.
-
Destructuring Defaults Are TRICKY?!
Destructuring defaults have LAYERS! Nested defaults work differently than you think. undefined triggers defaults, but missing properties don't! This is confusing!
#javascript #javascripttricks #destructuring #defaultvalues #nesteddestructuring #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #objectdestructuring #advancedjavascript
-
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:
#JavaScript #destructuring #defaults #parameterObjects #web #dev
-
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;
```#javaScript #webDev #frontend #backend #fullstack #nodejs #ecmascript #destructuring #es6
-
I found the `zeallot` package for destructuring/unpacking assignments in #Rstats. I'm familiar w/ #destructuring in JS and Python, had not really wondered about it in R until recently... how did I not know this existed?
https://github.com/r-lib/zeallot
Is this package the only implementation of destructuring in R? Is there an obvious implementation I just don't know about --- maybe something hiding in the #tidyverse?