There are many ways to do this. The most efficient way is to setup OpenGL state to match that of the object you want to draw, draw a bunch of geometry and pop the OpenGL state you setup. One way to do this is to use the jit.gl.material object to control shading and coloring and draw your object with the drawraw method. You can do this in JS, however there is an example in the jit.gl.lua helpfile. It should be pretty easy to translate to JS. When you open the helpfile, load the basic.draw.lua script.