--- title: Function.prototype.toSource() slug: Web/JavaScript/Reference/Global_Objects/Function/toSource translation_of: Web/JavaScript/Reference/Global_Objects/Function/toSource original_slug: Web/JavaScript/Referencia/Objetos_globales/Function/toSource ---
El método toSource()
devuelve un string representando el código fuente del objeto.
function.toSource();
Function.toSource();
Ninguno.
El método toSource
devuelve los siguientes valores:
toSource()
devuelve la siguiente cadena indicando que el código fuente no está disponible:
function Function() { [native code] }
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.
No está reflejado en ningún estándar. Implementaso en JavaScript 1.3.