how best to debug a data join?

In a cell of an observable notebook, I’m trying to join some data to some elements using D3. I’m making a mistake somewhere in my code, and trying to debug to figure out what’s going wrong.

I have a suspicion that the problem might be that I’m not successfully joining the data to the elements I’ve selected. So I’d like to log info about those elements to the console, in a way that will show whether the data I’m trying to join is in fact joined.

How do I do that?

I realize this might seem like a D3 question, rather than an Observable question. But I think that the fact that I’m trying to log to the console from an Observable notebook means that the scope of this goes beyond D3.

Thanks!

the nice thing about Observable notebooks is you can link directly to the problematic notebook, ideally after you have made a fork and golfed it down to the minimum