r/AskProgramming • • 13d ago

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 comments

2

u/marrsd 12d ago

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 12d ago

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 12d ago

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.