Name

arguments.callee Property — a reference to the function being executed

Availability

Flash 5

Synopsis

arguments.callee

Access

Read/write

Description

The callee property stores a reference to the function currently executing. We may use this reference to execute the current function again or to identify the current function through comparison.

Example

function someFunction ( ) {
  trace(arguments.callee == someFunction);    // Displays: true
}

// An unnamed recursive function
countToTen = function ( ) {
  i++; 
  trace(i);
  if (i < 10) {
    arguments.callee( );
  }
};

Get ActionScript: The Definitive Guide 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.