Javascript Array Question 10

Introduction

What is the output of the following code?

let mammals = new Array("cat","dog","human","whale","seal");
let animalString = "";
for (let i = 0; i < mammals. length; i++) {
   animalString += mammals[i] + " ";
}
console.log(animalString);


cat dog human whale seal



PreviousNext

Related