Task

Using two Arrays of equal length, create a Hash object
where the elements from one array (the keys) are linked
to the elements of the other (the values)



Related task

   Associative arrays/Creation


/* Hash from two arrays, in Jsish */
function hashTwo(k:array, v:array):object {
    var hash = {};
    for (var i = 0; i < k.length; i++) hash[k[i]] = v[i];
    return hash;
}
 
;hashTwo(['a','b','c'], [1,2,3]);
;hashTwo(['a','b'], [1,[2,4,8],3]);
;hashTwo(['a','b','c'], [1,2]);
;hashTwo([], []);
 
/*
=!EXPECTSTART!=
hashTwo(['a','b','c'], [1,2,3]) ==> { a:1, b:2, c:3 }
hashTwo(['a','b'], [1,[2,4,8],3]) ==> { a:1, b:[ 2, 4, 8 ] }
hashTwo(['a','b','c'], [1,2]) ==> { a:1, b:2, c:undefined }
hashTwo([], []) ==> {}
=!EXPECTEND!=
*/