r/AskProgramming • • Oct 12 '26

Worst programming language

For me I'm sorry but that's c no oops that's the heart of it's upgraded version cpp

0 Upvotes

21 comments sorted by

View all comments

Show parent comment

2

u/marrsd Oct 13 '26

This is a React thing. It's got nothing to do with Javascript. In JS, like most other languages, objects are always passed to or returned from functions by reference while primitives are passed by value.

1

u/BoBoBearDev Oct 13 '26

I think the problem is still inherently inside JS though. The reactjs just exposed it instead of doing a great job hiding it.

2

u/marrsd Oct 13 '26

Almost certainly not. I don't fully understand your problem, but both the dependency list examples you mentioned would be passed by value if myProperty is a primitive.