How can this fiddle work?

I “stole” a fiddle from Three.js Custom Geometry, and modified/simplified it quite a bit: Three.js - Custom BufferGeometry - Indexed - JSFiddle - Code Playground

Although I solved my original problem, I’m baffled at how it can work? Specifically, how can it reference THREE, seemingly without importing it anywhere???

Ditto for this codepen: https://codepen.io/steinhh/pen/eYMPEpg?editors=101

Sorry, this might be a question for fiddle itself, but it’s also a threejs thing…

it works because three.min.js creates THREE variable in the window (your THREE gets resolved to window.THREE)

Aaaah… right. Didn’t even think to look there. I wrote off index.html as standard fiddle boilerplate (#fiddlenoob), not something that might have any relevant side effects.

Thanks for answering so quickly!