Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 386 Bytes

Debug-js-code-using-console.trace.md

File metadata and controls

24 lines (17 loc) · 386 Bytes
  • Date : 2018-01-07
  • Tags : #javascript #debug

Debug js code using console.trace

Browsers provide an useful function help you debug easier than using simple console.log function.

That is console.trace, which prints a stack trace to called function.

Example :

function foo() {
	var a = 1;
	bar(a);
}
function bar(x) {
	console.log(x);
	console.trace();
}

foo();