最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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?

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?

Share Improve this question edited Jan 20, 2014 at 5:23 informatik01 16.4k11 gold badges78 silver badges108 bronze badges asked Jun 19, 2013 at 0:54 Ben DavidowBen Davidow 1,2155 gold badges27 silver badges55 bronze badges 2
  • 1 The "sources" tab has syntax highlighting. – jeremy Commented Jun 19, 2013 at 1:02
  • hi ben, if you are still active, it would be nice to accept one of these answers – Yılmaz Durmaz Commented Jul 20, 2018 at 15:11
Add a comment  | 

3 Answers 3

Reset to default 24

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.

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

As far as I am aware their is no way within the chrome dev tools but if you copy and paste the code into a program such as Notepad ++ or Dreamweaver and put your cursor to the right of one of the brackets then the corresponding bracket will be highlighted.

发布评论

评论列表(0)

  1. 暂无评论