Pregunta

In chrome, when you type a function in the console, the source code for that function is outputted. For example

>    $.rails.confirm
     function (message) {
        return confirm(message);
      }

But in firefox inspector's console, it just outputs

[object Function]

How do I see a function's source code in Firefox inspector, like in chrome?

¿Fue útil?

Solución

Just write in console function.toString(). Example:

alert.toString() will output:

"function alert() {
    [native code]
}"
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top