Return value in non-function Javascript code block
问题 I'm trying to work out what's going on in Mike Bostock's Box Plot example from the D3 gallery. Here's the code inside an Observable notebook: https://observablehq.com/@d3/box-plot In it there's a code block that does not appear to be a function definition but that has a return value: chart = { const svg = d3.select(DOM.svg(width, height)); const g = svg.append("g") .selectAll("g") .data(bins) .join("g"); // [...] return svg.node(); } What does return do or mean when it is not in a function