Hi, I have to disagree with you about pass by reference, objects and arrays are indeed passed by reference in function parameters. Simply because you can reassign what the local variable inside the function points to does not invalidate the fact that you can mutate the passed external object or array from inside that function.
This is a potentially dangerous "gotcha", and while you do state that you can mutate the object's properties, you need to acknowledge that they are passed by reference.
Don't let this detract from your article overall though, I enjoyed the read and these are definitely useful ones to learn fully, not just for the interview stage, but for understanding the fundamentals of how javascript works. So thank you for the time and effort you put in!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, I have to disagree with you about pass by reference, objects and arrays are indeed passed by reference in function parameters. Simply because you can reassign what the local variable inside the function points to does not invalidate the fact that you can mutate the passed external object or array from inside that function.
This is a potentially dangerous "gotcha", and while you do state that you can mutate the object's properties, you need to acknowledge that they are passed by reference.
Don't let this detract from your article overall though, I enjoyed the read and these are definitely useful ones to learn fully, not just for the interview stage, but for understanding the fundamentals of how javascript works. So thank you for the time and effort you put in!