Ari Seyhun
Ari Seyhun

Reputation: 12531

Chrome View Value Return Value of Function (Not Stored in a Variable)

Using Google Chrome, how can I view a function's return value when it is not stored in a variable?

For example, in the following code

if (d.jStorage.get("tmpdatas").step == d.jStorage.get("constraints").nb_max_questions) {
    return true
}

How am I able to see the value of d.jStorage.get("constraints").nb_max_questions) in Google Chrome's Debug Tools?

Upvotes: 2

Views: 861

Answers (1)

Matt Zeunert
Matt Zeunert

Reputation: 16571

You could copy the expression and paste it in the console, which will print the return value. However, a downside of this approach is that the function will be called twice, once by the application code and once by the code you pasted in the console.

You can also step into the get function, step through it, and then look for the return value in the Scope pane.

Upvotes: 4

Related Questions