Why can I not name a JavaScript function `all`?

Viewed 272

all is not a built-in function or keyword, but why can I not call a function if it is named all?

There is no error message in the debug console, and the function works if I rename it to all2.

Here is the code: tested in chrome and IE10

<!DOCTYPE html>
    <head>
    </head>
    <body>
    <script>
        function all()
        {
            alert(1);
        }
        function all2()
        {
            alert(2);
        }
    </script>
    <input type="button" value="all1" onclick="all()">
    <input type="button" value="all2" onclick="all2()">
    </body>
</html>
1 Answers
Related