The most viewed items
const tnwNames = ["Hla", "Mya", "Soe", "Moe", "Noe"];
function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNames.join(", ");
}
function tnwFun2(){
document.getElementById("demo").innerHTML = "The original array is :
" + tnwNames.join(", ");
let result = tnwNames.splice(2, 2, "Aung", "Kyaw", "Tun");
document.getElementById("demo1").innerHTML = "The removed elements are :
" + result.join(", ");
document.getElementById("demo2").innerHTML = "The new array is :
" + tnwNames.join(", ");
}
No comment to show.