Convert Array Into Hashmap Javascript Substring Email Gmail