// This example is from the book _JavaScript: The Definitive Guide_. // Written by David Flanagan. Copyright (c) 1996 O'Reilly & Associates. // This example is provided WITHOUT WARRANTY either expressed or implied. // You may study, use, modify, and distribute it for any purpose. function f(x, y, z) { // first, check that the right # of arguments were passed. if (f.arguments.length != 3) { alert("function f called with " + f.arguments.length + "arguments, but it expects 3 arguments."); return null; } // now do the actual function... }