The Core

Why We Are Here => Water Cooler => Topic started by: rcjordan on September 28, 2016, 10:37:46 PM

Title: JS: how to write this in dot notation?
Post by: rcjordan on September 28, 2016, 10:37:46 PM
       return getStyle(node)["display"] == "none";

I'm getting the message ["display"]  is better written in dot notation in the editor.
Title: Re: JS: how to write this in dot notation?
Post by: ergophobe on September 30, 2016, 04:07:52 PM
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?