Console dev tools

Console dev tools
0.0 0


whats the difference between

which one to use?

and i tried accessing my method in my object

var pizza = {

return this.toppings; }

with both of them different thigs happen in the console
with this one

i get value from the return.this toppings;
and with the 2nd one i just get
this in my console

return this.toppings; }```


This page may help. A quick check to see the difference yourself is to type the following into your console and note the differences.

console.log([1, 2]);
console.dir([1, 2]);

In terms of the functions and parentheses, without the parentheses (when you type console.log(pizza.howmanyToppings), the console will output the function definition itself, which you have noted. Adding the parentheses actually evaluates the function, which is why you get an actual value.

I hope that helps.