JS: how to write this in dot notation?

Started by rcjordan, September 28, 2016, 10:37:46 PM

Previous topic - Next topic

rcjordan

       return getStyle(node)["display"] == "none";

I'm getting the message ["display"]  is better written in dot notation in the editor.

ergophobe

I don't recognize that syntax I'm sorry to say.

It looks like you're using a function call to get the name of the object?


getStyle["display"](node) could be rewritten as getStyle.display(node) but I'm not sure what's going on there. Does this actually work?