When I try to console.log strings in an array it prints each text character and the comma separators on a separate line:
var name = ["add","bas","cun","deh"];
var size = [2,5,7,9];
var price = [250,150,25,60];
var count = 0;
var mVar = 4;
var nameLen = name.length;
while (count < mVar) {
var maxSize = Math.max.apply(null, size);
var posVar = size.indexOf(maxSize);
console.log(name[posVar] + " " + size[posVar] + " " + price[posVar]);
size[posVar] = null
count++;
}
When I view the console, these are my results: