Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.02 KB

File metadata and controls

40 lines (26 loc) · 1.02 KB
title slug original_slug
Function.prototype.toSource()
conflicting/Web/JavaScript/Reference/Global_Objects/Function/toString
Web/JavaScript/Reference/Global_Objects/Function/toSource

{{JSRef}} {{non-standard_header}}

El método toSource() devuelve un string representando el código fuente del objeto.

Sintaxis

function.toSource();
Function.toSource();

Parámetros

Ninguno.

Descripción

El método toSource devuelve los siguientes valores:

  • For the built-in {{jsxref("Function")}} object, toSource() devuelve la siguiente cadena indicando que el código fuente no está disponible:

    function Function() {
        [native code]
    }
  • En funciones personalizadas, toSource() devuelve el código JavaScript que define el objeto como un string.

Éste método es usado de forma interna por JavaScript y no explicitamente desde el código. Puedes usar toSource mientras depuras para examinar el contenido de un objeto.

Ver también

  • {{jsxref("Object.prototype.toSource()")}}