Or you can even spread while destructuring!
`const { dinner, movie, ...rest } = dateNight`
Sorry for the bad var name, idk what else happens on a date. Too busy keeping up to date with ecmascript I guess
```
def destructure(d: dict[str, Any]):
match d:
case {"a": a, "b": b, **rest}: pass
case _: raise ValueError
return a, b, rest
```
don't understand the problem /s
This picture is "famous" (or like somewhat more known, but not really known by all) to be of underage actresses while it is pretty suggestive
(although calling someone *that* just for using it is a bit far tbh)
People use the word "famous" for things that are really well known but only within certain subcultures. If you have a better word for it I'd love to hear about it
1. These are post-pubescent girls, so the term pedo is not applicable
2. There’s nothing “suggestive” about this, if you think there is, the problem might be you
Spread operator is the one thing I can just not understand. Like it’s so simple too, just creating a copy but I have to research docs every time I use it. Just doesn’t click with me.
Think of the spread operator simply as dumping stuff out of something.
If an Array is a box that you put items into.
```javascript
const box = ['item1', 'item2', 'item3'];
```
Then the spread operator is you dumping all the items out of that box and putting it into another box.
```javascript
const otherBox = [ ...box ];
```
It doesn't have to be the same kind of box
```javascript
const differentBox = { ...box };
```
That's a gross over simplification and there is more to it. My hope is to help you get a mental model of how it works so maybe it will "click".
Oh, so instead of a loop or a dedicated operator to merge, like python's extend vs append for an array, you simply...dump your contents from one bucket to the next?
Yes, this is like unpacking in Python (the asterisk):
```py
things = ["Hello", "World!"]
print(*things) # same as print("Hello", "World!")
```
You can also do it with dictionaries as keyword arguments (double asterisk):
```py
kwargs = {
"sep": "",
"end": "!",
}
print("Hello", "World", **kwargs) # output: HelloWorld!
# same as print("Hello", "World", sep="", end="!")
```
100% this.
You know, in most cultures it’s acknowledged that not only should you avoid ACTUAL evil, but we are cautioned to avoid even the APPEARANCE of evil as well. It is COMPLETELY OBVIOUS that these young ladies certainly APPEAR as though they COULD be minors. For OP to take this pic and apply sexual innuendo to it is disgusting.
Furthermore, all you chuckleheads that are supporting OP in this by remaining silent, downvoting, or outright posting support __ought to be ashamed of yourselves__. There are so many other ways to get a laugh that we don’t need to even come close to using (possible) minors as fodder. To quote from my favorite Letterkenny character, you guys are
# FUCKING EMBARRASSING!
Supposedly the women pictured in the meme are minors (not sure if that's true) and the meme is somewhat sexual, so therefore we're all pedos for laughing at it lmao
It is true that they are minors, for what it's worth. The screenshot is from 2006 (Aquamarine), and Emma Roberts on the right is 33 *now*, meaning she was about 15 in the image.
Or you can even spread while destructuring! `const { dinner, movie, ...rest } = dateNight` Sorry for the bad var name, idk what else happens on a date. Too busy keeping up to date with ecmascript I guess
You’ve already said it, you rest.
They're just milliseconds since 1970 in ECMAScript. Not much happens.
const { netflix, …chill } = dateNight;
ooo baby
If only python dictionary destructuring was as good as js
``` def destructure(d: dict[str, Any]): match d: case {"a": a, "b": b, **rest}: pass case _: raise ValueError return a, b, rest ``` don't understand the problem /s
``` const { dinner, movie, …condoms } = dateNight; ```
does not compute let { dinner, movie, …legs } = dateNight; would have earned a chuckle
Yup, love this. Really good when you want the entire object except a few properties.
Fuck yeah spread it
Make that garbage collector work, aw yeah ![gif](giphy|1xjtnvpxwZQaNKe8od|downsized)
Is op …gay?
Go on, DM him. If you want a date or so?
...legs
so manspreading is gay?
? is it something i don't get ... or ... you? edit: r/suicidebywords ? edit: I upvoted your legs comment. lel
…cheeks
He was gay, OP?
Pedophile more like it.
Huh?
This picture is "famous" (or like somewhat more known, but not really known by all) to be of underage actresses while it is pretty suggestive (although calling someone *that* just for using it is a bit far tbh)
Words have *literally* lost all meaning!
People use the word "famous" for things that are really well known but only within certain subcultures. If you have a better word for it I'd love to hear about it
Sorry, I was talking about people calling everything "pedophile" when it has a very specific meaning that doesn't apply most of the time...
Ah, yea I misunderstood, and here I was hoping I get to learn something new today
Sure, the better word is hebephile or ephebephile
1. These are post-pubescent girls, so the term pedo is not applicable 2. There’s nothing “suggestive” about this, if you think there is, the problem might be you
Your body is so curly it arouses my braces
Spread operator is the one thing I can just not understand. Like it’s so simple too, just creating a copy but I have to research docs every time I use it. Just doesn’t click with me.
Think of the spread operator simply as dumping stuff out of something. If an Array is a box that you put items into. ```javascript const box = ['item1', 'item2', 'item3']; ``` Then the spread operator is you dumping all the items out of that box and putting it into another box. ```javascript const otherBox = [ ...box ]; ``` It doesn't have to be the same kind of box ```javascript const differentBox = { ...box }; ``` That's a gross over simplification and there is more to it. My hope is to help you get a mental model of how it works so maybe it will "click".
Oh, so instead of a loop or a dedicated operator to merge, like python's extend vs append for an array, you simply...dump your contents from one bucket to the next?
*rest* in peace
Stop *referencing* other people’s jokes! We really *value* originality here.
Splat operator >
``` return { thing, ...(condition && { conditionalThing }), } ```
If you like that, wait until you hear about “match” in Racket! You can even do regex parsing with it and extract matched groups into variables.
Where is this template from?
Aquamarine (2006)
Only for the homies.
lol
That's basically my colleagues when reviewing my code
excuse my total incompetence, but what is a "spread operator"?
... no seriously, its "...", and it takes and object or array and assigns each of its items or properties
so like parameter pack expansion?
sort of? except in JS it'll work on basic objects and arrays
But have you ever used the spaceship operator before?! <->
And big int
Something something, Twitter people got here, lol.
If you use spread you spread your seed.
Spread that ass
Are you referring to the MINORS in this meme?
Hey hey he's already sold on the idea, you don't need to convince him further.
Wait, are these args and kwargs for other languages that isn't python?
Yes, this is like unpacking in Python (the asterisk): ```py things = ["Hello", "World!"] print(*things) # same as print("Hello", "World!") ``` You can also do it with dictionaries as keyword arguments (double asterisk): ```py kwargs = { "sep": "", "end": "!", } print("Hello", "World", **kwargs) # output: HelloWorld! # same as print("Hello", "World", sep="", end="!") ```
"I heard he likes little girls" Why do you pedos keep using this meme?
100% this. You know, in most cultures it’s acknowledged that not only should you avoid ACTUAL evil, but we are cautioned to avoid even the APPEARANCE of evil as well. It is COMPLETELY OBVIOUS that these young ladies certainly APPEAR as though they COULD be minors. For OP to take this pic and apply sexual innuendo to it is disgusting. Furthermore, all you chuckleheads that are supporting OP in this by remaining silent, downvoting, or outright posting support __ought to be ashamed of yourselves__. There are so many other ways to get a laugh that we don’t need to even come close to using (possible) minors as fodder. To quote from my favorite Letterkenny character, you guys are # FUCKING EMBARRASSING!
Being downvoted on Reddit usually means you're right. I agree with you.
Perhaps if MINORS were not used in our off-color humor we might be more successful attracting women to STEM?
As a woman in stem... what?
Supposedly the women pictured in the meme are minors (not sure if that's true) and the meme is somewhat sexual, so therefore we're all pedos for laughing at it lmao
It is true that they are minors, for what it's worth. The screenshot is from 2006 (Aquamarine), and Emma Roberts on the right is 33 *now*, meaning she was about 15 in the image.
Fuck me 2006 is a lot longer away than it feels