Created
September 25, 2012 10:39
-
-
Save mraleph/3781116 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var a = "a"; | |
| var b = []; | |
| for (var i = 0; i < 10; i++) { | |
| a += a; | |
| b.push(a); | |
| } | |
| b = b.join(''); | |
| // here a is a dag of cons-strings (rope), b is a flat string (like a normal char[]) | |
| a.charCodeAt(123); // here a gets flattened into a flat string. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment