Update main.js

types.join(), once instead of twice