d3 examples, is chart = { ... } a function or class or object?

74 Views Asked by At

In all the d3 examples like this one , the svg appending part of the code is encapsulated in

chart = { 
    ... lines and lines of codes ...
}

I first thought it is a function, since there's a return statement in it. But of all the arrow function I read up in MDN seemed all require an arrow =>.

Is this a object? But object are variables and functions with colons, but this one do not.

I'm confused as to what it is. Could you help me to understand?

1

There are 1 best solutions below

0
On

The best way to understand the Observable's samples and work with them, is to download the code and run it in a fiddle, sandbox, or any other environment.

enter image description here