I recently read somewhere somewhere that calling a function within a loop is considered bad practice. Is this true? So for example, if I had the following:
function foo(value){
console.log(value);
}
var bar = ["Foo", "Bar"];
for(var i = 0; i < bar.length; i++){
foo(bar[i]);
}
Is it bad practice do do this? Should there be another way I should be calling foo?
Note: This question is not specific to Javascript, it's just what I wrote the question in.