javascript-allonge-six
javascript-allonge-six copied to clipboard
Ch.1 "Copy on Write", issues with the copy function.
I'm new to JS so it's entirely possible I'm just not understanding how the copy function should work. However, in my Firefox browser (which had no issues with any example up to this point in the text), copy does not seem to work at all.
Here's a code snippet displaying the issue:
>> parentList
<- Object { first: "one!", rest: Object }
>> copy(parentList) // does not have any result
>> var thing = copy(parentList);
>> thing
<- undefined
I'm not sure what's happening in your browser, but here's an es6fiddle demonstrating the copy-on-write code:
http://www.es6fiddle.net/ika6lvz5/