const jonas = [
  "Jonas",
  "Schmedtmann",
  new Date().getFullYear() - 1986,
  "developer",
  ["Nika", "Joanne", "Eva"],
];

for (let i = 0; i < jonas.length; i++) {
  console.log(`${i} ${jonas[i]}`);
}

console.log("----------");

let counter = 0;
while (counter < jonas.length) {
  console.log(`${counter} ${jonas[counter]}`);
  counter++;
}

for (let exercise = 1; exercise <= 3; exercise++) {
  console.log(`------ Starting exercise ${exercise}`);
  for (let rep = 1; rep < 6; rep++) {
    console.log(`Exercise ${exercise}, lifting weight repetiton ${rep}`);
  }
}

console.log("---- Exercise trough the a while loop ------");
let exercise = 1;
while (exercise <= 3) {
  console.log(`------ Starting exercise ${exercise}`);
  let repetition = 1;
  while (repetition < 6) {
    console.log(`Exercise ${exercise}, lifting weight repetiton ${repetition}`);
    repetition++;
  }
  exercise++;
}

let getRandom = () => {
  return Math.trunc(Math.random() * 6 + 1);
};
let dice = getRandom();

while (dice !== 6) {
  console.log(`You rolled a ${dice}`);
  dice = getRandom();
  if (dice === 6) console.log("Loop is ended!");
}
