arguments.callee

JavaScript 1.2+, ECMAScript 1.0+ Nav4+ Syntax

arguments.callee

Description

The callee property of the Arguments object contains the function that is currently executing. This is useful if the function has no name.

Example

In Listing 6.44, a function is created to display a individual's favorite food in an alert box. The function is called when the buttons are clicked. The code that makes up the executing function is displayed using the callee property.

Listing 6.44 Using the callee Property of the Arguments Object
 <html> Learn what functions are used when you press the buttons below that represent a person's favorite food! <form> <input type="button" value="Meredith" OnClick=displayFood(this,"pizza")> <input type="button" ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.