Slice and Splice methods using Arrays in Java script

Slice and Splice methods using Arrays in Java script





<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Slice and Splice</title>



</head>
<body>
<script>

var numb=[1,2,3,4,5,6,7];
var ver= numb.slice(2,5);

if(Array.isArray(ver)==true)
{
console.log("The elements of the new array are as follows  : " +  ver);
}
else
console.log("No!! it's not an array");

</script>
</body>
</html>





Comments

Popular posts from this blog