Javascript Transform Array Into String Javascript Functions