Javascript madness

Apr 25, 2008 11:13

Just found out a freaky thing about Javascript. Not only does each function have an argument.object that includes a callee field containing the function itself (allowing anonymous recursive functions), you can rewrite it. The code behind the cut defines a function that always makes a recursive call at the end, except to escape it rewrites its own identity. Tee-hee:)


Rewriting anonymous recursive functions

javascript, anonymous functions, recursion, programming

Previous post Next post
Up