Alright, I've come across an issue with a simple for loop embedded within a function that requires an array as its sole parameter. The condition for the loop is set as array.length.
Within the loop, I'm utilizing an undefined variable along with a document.write.
The dilemma lies in the fact that Javascript terminates the loop after one iteration due to the unset status of variable y. I initially anticipated the loop to iterate through (array.length).
If you wish to delve into this further, check out the following CodePen: http://codepen.io/anon/pen/wmlBC (uncomment var y).
function checkName(array){
var i = 0;
var y = "";
for(i = 0; i < array.length; i++){
y += array[i]
}
return y;
}
var arrayNames = ["liselore", "karel", "david", "stefan", "kevin", "sandy"];
console.log(checkName(arrayNames));