Are JScript strings passed by value or by reference?

I was describing some of the semantics of reference types earlier, and that reminded me of one of the first questions I was ever asked about reference semantics.

Pop quiz: Are JavaScript strings passed by reference (like objects) or by value (like numbers)?

I’ll post the answer tomorrow.

Advertisements

1 thought on “Are JScript strings passed by value or by reference?

  1. Pingback: Porting old posts, part 1 | Fabulous adventures in coding

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s