Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to find matching (closing) JavaScript bracket in Chrome Devtools?

JavaScript newbie here. I'm reviewing a big swath of JS code using devtools and I'm wondering if there's an easy way to locate where the closing bracket is on a function. Is there a feature where I can highlight an opening bracket and pinpoint where the closing bracket is located?

like image 329
Ben Davidow Avatar asked Jun 19 '13 00:06

Ben Davidow


People also ask

How do I find my call stack in Chrome?

To view the call stack, open DevTools Sources panel and on the right panel, expand the Call Stack panel to see all the current functions in the call stack.


2 Answers

You can use a chrome devtool shortcut. First move the cursor next to opening or closing bracket then do CTRL + m. Note this also works for parenthesis and curly brackets.

To see all the available shortcuts click on three dots icon at the top right side of devtools then click on Shortcuts.

like image 112
Ara Yeressian Avatar answered Nov 15 '22 23:11

Ara Yeressian


You should use the sources tab. It has few buttons in the footbar, which has pretty print which looks like this: {} which displays the formatted JS. When you put your cursor on a brace the other (closing or opening ) brace is automatically matched for you.

For latest devtools in chrome, use chrome canary.

refer > https://developers.google.com/chrome-developer-tools/docs/javascript-debugging

like image 45
thoughtbot Avatar answered Nov 16 '22 00:11

thoughtbot