Created
October 12, 2020 06:02
-
-
Save Achie72/f3561bec44fea880065b771164864b74 to your computer and use it in GitHub Desktop.
Damn
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
var a = new Float32Array([1,3,6,7,8,12]); | |
var b = a.filter(function(x){ | |
return x > 0; | |
}); | |
print( typeof Object.getPrototypeOf(b)); | |
var sample = new Float32Array(4); | |
var calls = 0; | |
sample.constructor = { get [Symbol.species]() { calls++ } }; | |
var result = sample.filter(function() { return true;}); | |
print( calls) | |
print( typeof Object.getPrototypeOf(result)); | |
print(result.length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment