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.
function.toSource();
Function.toSource();
Ninguno.
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.
- {{jsxref("Object.prototype.toSource()")}}