-
-
Save vhf/a884c556a70bdcf21fbc 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 reassignedDefinedParameters(x) { | |
x = x < 0 ? x : -x; // reassign default parameter x | |
var y = arguments[1]; // mention arguments. Actually use it. | |
x = x + y; // again | |
return x + y; // actually use both | |
} | |
reassignedDefinedParameters(1, 1); | |
reassignedDefinedParameters(1, 1); | |
/* | |
compiling method 0x71... <JS Function reassignedDefinedParameters (SharedFunctionInfo 0x32...)> using Crankshaft] | |
[optimizing 0x71... <JS Function reassignedDefinedParameters (SharedFunctionInfo 0x32...)> - took 0.044, 0.089, 0.024 ms] | |
reassignedDefinedParameters is optimized | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment