I've been experimenting with three.js, specifically the Editor feature that allows you to attach scripts to 3D objects. In Unity 3D, accessing a script is as simple as using something like :
targetGameObject.GetComponent (scriptName).targetVariable;
How can this be achieved in three.js?