Search code examples
javascriptjsfiddle

How to show console in jsfiddle


How can i display the console for debugging JavaScript on jsfiddle.net? I only see a results tab. When trying to do a console.log('test'); only a white result tab appears.

Does a console panel exists at all?


Solution

  • Normally by pressing F12 or using inspect on your result pane.

    Alternatively add

    https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js

    to the resources on the left as seen here

    for (var i = 0; i < 5; i++) {
        console.log(i); // 0, 1, 2, 3, 4
    }
    
    console.log({
        foo: 'bar',
        baz: function() {}
    });
    console.log([1, 2, 3]);
    console.log(window.alert);
    
    throw new Error('This is error log..');
    <script src="https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js"></script>

    Old answer

    Until recently if you wanted the "Stacksnippet Console" type of console, you could choose jQuery and turn on Firebug which would show console messages in the result pane:

    enter image description here