Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Or Clone? #42

Open
hasezoey opened this issue Nov 10, 2019 · 0 comments
Open

Reference Or Clone? #42

hasezoey opened this issue Nov 10, 2019 · 0 comments

Comments

@hasezoey
Copy link

In the examples given, it is unclear to me: what are references to values and what are "clones"?

like the following:

let string1 = "String 1"
let string2 = string1 # will this be a clone or a reference?
let obj1 = {
  key1: "Key 1"
}
let obj2 = obj1 # will this be a clone or a reference?

(2 examples, because in a language like JavaScript, a primitive is a clone, and an object is a reference)

and for functions:

let func1 = fn (var1, var2) { } # will var1 & var2 be clones of the original values, or references?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant