`addAttribute` doesn't need to return the `attribute` parameter. It modifies the elements of an array; it doesn't create a new array. You can remove the return statement from that function and here you can remove some assignments. This could be compressed to

`addAttribute(attr.normals, normal, front, back);`

You probably don't have to return `attr` from here for the same reason.