splice in javascript

     Remove the existing value from the array and return the removed values. In this method original array is affected.

Syntax

     array.splice(start,deletecount[,newval1,newval2,newvaln]);
Example

     var ar=["red","green","Apricot","Guava"];

     ar.splice(0,2,"Apple","Banana");



Example Program:- (Editor)


Editor is Loading...

Advertisement




Tag:
Javascript in allinworld99, splice in javascript, usage of splice in javascript

Nhận xét

Bài đăng phổ biến từ blog này

How to set the SDK, NDK and JDK path to android studio?

physicsjs - Increase the restitution value for circle and retangle

Select all values from list box in a single click using javascript