galaxy brain code from work today :marseymindblown::taymindblown:

!codecels

46
Jump in the discussion.

No email address required.

Javascript is so cringe lol, you see that json stringify/parse thing everywhere for cloning objects because it's either that, importing fricking jquery (ick) or writing your own custom clone script for every use case

Shit-tier language for shit-tier devs (webcels)

Jump in the discussion.

No email address required.

>Javascript is so cringe lol, you see that json stringify/parse thing everywhere for cloning objects because it's either that, importing fucking jquery (ick) or writing your own custom clone script for every use case

bb the fuck u talm bout jquery. 💀💀 dumbass redditor hahaha 😭😭 blamin ur tools every time u talk code ur so smug and wrong lmaooo!! nigga watch me clone that shit in 1 line

const clonedObj = {...obj1};

!codecels look at this queef cake :taylaugh:

Jump in the discussion.

No email address required.

javascript does suck tho

Jump in the discussion.

No email address required.

I think he means deep cloning (I would not know, as I am not a webshit).

Jump in the discussion.

No email address required.

that is a deep clone it copies the fields. obj2 = obj1 makes a shallow copy.

Jump in the discussion.

No email address required.

obj1 = obj2 is assignment (does not copy anything), obj1 = {...obj2} is shallow copying, obj1 = JSON.parse(JSON.stringify(obj2)) is deep copying. :marseyretard3:

Jump in the discussion.

No email address required.

:#marseywtf:

Neighbor I sure as heck hope you aint getting paid as a js dev

But then I remember is-odd exists

Jump in the discussion.

No email address required.

Who needs to deep clone shit these days?

Jump in the discussion.

No email address required.

Deep cloning considered harmful: mutation is evil, chud!

Jump in the discussion.

No email address required.

I don't think destructuring assignment on its own would create a deep copy.

Jump in the discussion.

No email address required.

Oh, that's what it's for. It's extra r-slurred in this case tho because it starts with an object literal except it's a string literal. Also it doesn't work because of that.

Jump in the discussion.

No email address required.

Who uses jquery in 2023?

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

:marseythumbsup:

Jump in the discussion.

No email address required.

Lodash too

Jump in the discussion.

No email address required.

Everytime I open a JSON I sing "JSON Derulo" to myself :marseysing:


https://i.postimg.cc/dVgyQgj2/image.png https://i.postimg.cc/d3Whbf0T/image.png

Jump in the discussion.

No email address required.

holy shit !besties

Jump in the discussion.

No email address required.

:marseygossipblush:

Jump in the discussion.

No email address required.

I always think of the JASON scene from Heavy Rain

Jump in the discussion.

No email address required.

:#marseyclappingglasses:

Jump in the discussion.

No email address required.

some tim i make good code :marseyteehee:

Jump in the discussion.

No email address required.

u r so 1337

Jump in the discussion.

No email address required.

Web code is for normies.

Jump in the discussion.

No email address required.

the jabascrip make do big monys

Jump in the discussion.

No email address required.

It's okay, calc 2 is hard.

Jump in the discussion.

No email address required.

Web development is so gay

Jump in the discussion.

No email address required.

imagine your mom gagging on my peepee while your dad watches and jacks off and you can hear the moans because you still live with your parents since youre a worthless drain on society and then your mom's bull (who's your real dad by the way) walks in and then butt r*pes your dad because hes a fricking cute twink just like his son and you try to jack off to the sounds of your dad getting r*ped but you cant get your micropeepee up because you already jacked off to chinese cartoons 3 times today and so you hang yourself with a playstation controller because youre a fricking manchild and dont have a belt since you dont have a job you worthless fricking oxygen theif

wouldnt that be something

Jump in the discussion.

No email address required.

that plus you can't even code json

Jump in the discussion.

No email address required.

In python, using newobj = unpickle(pickle(obj))is around 2 orders of magnitude faster than deepcopy

Jump in the discussion.

No email address required.

that's... fricking sad

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.