Is there a way to search all the local and global variables for a value in javascript when a breakpoint is hit in devtools?

643 Views Asked by At

Is there a way to search all the local and global variables for a value in Javascript when a breakpoint is hit in devtools? For example, I know there's a value 'John Smith' held by some variable. I want to locate that variable. I don't know which variable it is. It would be nice if it can search through collections and arrays as well. Either a built-in feature in one of the browsers or a code snippet I can run.

1

There are 1 best solutions below

0
Sebastian Zartner On

As far as I know, none of the DevTools allows to search a variable by its value, they only list the variables and properties grouped by their scope when the script execution is stopped.