-
-
Save caitp/189ad92b55c9f871d55b to your computer and use it in GitHub Desktop.
It's kinda broken, but at least it's creating arrays of the right sizes and not crashing <_<
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
STRICT MODE | |
[] | |
[3,32767] | |
[2] | |
SLOPPY 'FAST' MODE | |
[] | |
[3,32767] | |
[2] | |
SLOPPY 'SLOW' MODE | |
[2] | |
[4,32767,null] | |
[3,32767] |
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() { | |
"use strict"; | |
function fn(a, ...b) { | |
return b; | |
} | |
print("STRICT MODE"); | |
print(JSON.stringify(fn(1))); | |
print(JSON.stringify(fn(1, 2, 3))); | |
print(JSON.stringify(fn(1, 2))); | |
print("\n"); | |
})(); | |
(function() { | |
function fn(a, ...b) { | |
return b; | |
} | |
print("SLOPPY 'FAST' MODE"); | |
print(JSON.stringify(fn(1))); | |
print(JSON.stringify(fn(1, 2, 3))); | |
print(JSON.stringify(fn(1, 2))); | |
print("\n"); | |
})(); | |
(function() { | |
function fn(a, a, ...b) { | |
return b; | |
} | |
print("SLOPPY 'SLOW' MODE"); | |
print(JSON.stringify(fn(1, 1))); | |
print(JSON.stringify(fn(1, 1, 2, 3))); | |
print(JSON.stringify(fn(1, 1, 2))); | |
print("\n"); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment