QP School
JavaScript Array fill() method examples - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: JavaScript Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=6)
+--- Thread: JavaScript Array fill() method examples (/showthread.php?tid=4086)



JavaScript Array fill() method examples - Qomplainerz - 04-04-2023

Code:
const fruits1 =
      [
        "Banana",
        "Orange",
        "Apple",
        "Mango"
      ];

document.getElementById("demo1").innerHTML = fruits1.fill("Kiwi");

const fruits2 =
      [
        "Banana",
        "Orange",
        "Apple",
        "Mango"
      ];

document.getElementById("demo2").innerHTML = fruits2.fill("Kiwi", 2, 4);