The most viewed posts

Registry Reviver

Web Development Services

How to clean up Windows Computer

About Desktop Icons in Windows Computer

How to make a computer secure and run faster

Driver Booster

Myanmar font and keyboard for Windows

CCleaner

Contact Me

Advanced System Care

The most viewed items

Dell Inspiron 5559

Desktop Hard Disk

HP ProBook 430

Laptop RAM

SONY Playstation Portable

External Hard Disk

Laptop

ZilaStar ICT Aug 19 2021, 19:47:15
Category : JavaScript Tutorials

splice (JavaScript Array Method)

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(", ");
}

  • Comments:

    No comment to show.

    To Contact
    Available Services
    Terms and Conditions