views:

31

answers:

3

Visual Studio 2010 shows '{...}' in the debugger as the value for a Javascript variable. The type is object. How can I view the contents of the variable? There's no expansion icon.

A: 

Probably the object variable has no properties. Any object which has no properties will show the value as "{...}"

Kunal
The variable was used in an equation as in var callback = somefunctionname and then it was used as an argument to a function. Then callback showed as {...} in the debugger.
Tony_Henrich
A: 

You could check in in code with the following:

var obj = {mem:1};

for (var a in obj)
{
    alert(a); //alert the object member
    alert(eval("obj." + a)); //alert the member value
}​

See it at this fiddle: http://jsfiddle.net/uG6H6/

James Wiseman
A: 

A function was assigned to the variable. Visual Studio doesn't seem to show anything when a function is assigned to a variable.. There's more information in Firebug.

Tony_Henrich