Write a function named "indexed_kvs" that doesn't take any parameters and returns a new key-value store containing the integers from 0 to 47 as values each stored at a key which is a string containing the digits of the integer. For example the key-value "0":0 will be in your returned key-value store (include both 0 and 47 in your list) (My code below)
function indexed_kvs(){
var d = (dict = []);
for (var i of Array(47).keys()) {
d = dict.push(i);
}
return d;
}
I keep on returning the input 47, instead of the keys and values ranging from 0 to 47. How can I fix this?
push()is the new length of the array.