Given an array, return one value at a time with each function call. I need to make a function where I'm given an array of items and I need to return one value at a time until the last value.
I looked in on some answers and this is something that I thought would work but it's an infinite loop.
Am I close to a solution? Where am I going wrong?
function functionName() {
var vals =
["shot_type","shot_height","shot_angle","framed","scene_depth"];
for(var i=0; i<vals.length; i++) {
functionName(vals[i]);
}
}
functionName(); //expect 'shot type'
functionName(); //expect 'shot height'
functionName.