Created
October 23, 2009 14:01
-
-
Save NV/216899 to your computer and use it in GitHub Desktop.
This file contains 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
function source_of (array, up_to_dimension) { | |
// Your implementation | |
} | |
source_of([1, [2, [3]]], 0) == '[1, ?]' | |
source_of([1, [2, [3]]], 1) == '[1, [2, ?]]' | |
source_of([1, [2, [3]]], 2) == '[1, [2, [3]]]' | |
source_of([532, 94, [13, [41, 0]], [], 49], 0) == '[532, 94, ?, ?, 49]' | |
/* | |
Function must work at least in latest versions of Firefox, Opera, Safari and IE. | |
You must not use regexps. Performance really important issue. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment