Completed vector_type.js from Eloquent Javascript