Lets say we’re looking for function named foo
:
- (open Chrome dev-tools),
- Windows: ctrl + shift + F, or macOS:
cmd + optn + F. This opens a window for searching across all scripts. - check “Regular expression” checkbox,
- search for
foo\s*=\s*function
(searches forfoo = function
with any number of spaces between those three tokens), - press on a returned result.
Another variant for function definition is function\s*foo\s*\(
for function foo(
with any number of spaces between those three tokens.