11

I have a JavaScript variable that is storing some values.

Can I echo it in Firebug or somewhere to see what values are being stored?

var p = user.permissions;
4
  • in chrome, you can use console.log(value); Commented Jul 25, 2012 at 19:19
  • I think console.log works in every js debugger that has a console. Commented Jul 25, 2012 at 19:21
  • 1
    i get this error: console.log(p); ReferenceError: p is not defined Commented Jul 25, 2012 at 19:22
  • Does this answer your question? JavaScript: How do I print a message to the error console? Commented Mar 14, 2022 at 15:18

1 Answer 1

21

Never mind. I had to add this line

var p = user.permissions;

Before:

console.log(p);

I was just typing console.log(p);

Sign up to request clarification or add additional context in comments.

1 Comment

is there a way to display the runtime value of a variable by printing the value of the variable using some console commands?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.