HEADER ADS 728X90

JavaScript Slice & Splice Function Tutorial | Javascript Tutorial: 26 | BY CodePrime

codeprime,codeprime js,javascript,javascript tutorial for beginners,javascript tutorial,slice,splice,slice(),splice(),javascript array slice,javascript array splice,javascript slice tutorial,javascript splice tutorial,javascript array tutorial in hindi,javascript tutorial in hindi,learn javascript in hindi,javascript for beginners,javascript crash course,programming tutorial javascript,javascript youtube tutorial,add new value in javascript array,Array,function, coding tutorial, how to learn coding easy way to learn coding

Hi dear welcome to "CodePrime" Blog . In this post you are going to learn JavaScript Slice & Splice Function Tutorial | Javascript Tutorial: 26 . First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat slice-and-splice.j.css file Then Copy The JS CODE and pest it then open the index.html file with your browser.

HTML CODE

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="/slic-and-splice.js"></script>
    <title>javascript</title>
</head>
<body >
    <br><br>
    <h2>Javascript Tutorial <br>By Codeprime</h2><br><br><br><br>

   

</body>

<style>
    h2{
        color:#fff;
        background-color: #000;
        padding: 5px;
    }
</style>
</html>

JAVASCRIPT CODE

//slice example
document.write("<h2> Slice() - Example</h2>")

var a = ["Hanif", "Rubia", "Hassan", "Abbas"];
document.write(a + "<br><br>")

var b = a.slice(-3, -2);
//index you can add positive or negetive value

document.write(b + "<br><br>")



//splice example
document.write("<h2> Splice() - Example</h2>")

var a = ["Hanif", "Rubia", "Hassan", "Abbas"];
document.write(a + "<br><br>");

a.splice(2,3, " Basir", "Ridoy");
//index you can add positive or negetive value

document.write(a + "<br><br>");



Youtube Tutorial

FLOW US ON SOCIAL MEDIA

Post a Comment

0 Comments

Join Telegram