how to get console.trace code example Example 1: javascript dump strack trace console.trace(); Example 2: js log stack trace console.log(new Error().stack);