As a fun exercise, I'd like to make a function that looks like a browser native function, so it should look like: function x() { [native code] }
Now, I came real close to figuring it out, as I made the following function: function x() { [native, code] }
- it simply creates an array with two elements: native
and code
, both are undefined. It's pretty useless, but it looks just like a native function, except for the comma.
So I began looking for a way to eliminate this comma, and my first thought was using some kind of character that looks like a space but isn't really functioning as one (since JS now supports unicode), but it seems like every space-like character I found is actually functioning as a regular space.
So, does anyone as an idea how can I eliminate this comma and make the function look like a native function?
Please don't write stuff like "override toString
" or "you can use space if you use brackets" because that's obviously not what I'm trying to achieve.