Posted on

This video is part of our Kickstarter-funded course “The Complete Mobile Game Development Course – Make 15 Games”. Access here:

In this tutorial we cover array manipulation in JavaScript. How to add elements to an array using push, how to remove the last element of an array using pop. How to add and remove multiple elements of a JavaScript array using splice.

GameDev Academy:
HTML5 Hive:
De Idea A App:
Twitter: @ZenvaTweets


Xem thêm bài viết khác:

5 Replies to “How to Remove and Add Elements to a JavaScript Array”

  1. Thanks ! I just did something that doesn t work. can you give me an hand.


    var tab = new array();
    var add_A_number = prompt("you want to add a number to the Array ? YES : press [ y ] and press [ enter ], "+
    "n NO : press [ n ] and press [ enter ] ");
    if(add_A_number === ("y")){
    alert((tab.length +1 )+ "th value of the table n"); // alert
    }while(customer === ("y"));


    function Add(){
    var number = prompt("Please enter the number you would like to add to the Array :");
    for (i=0; i<tab.length; i++){
    document.write(tab[i]+' ');

Leave a Reply

Your email address will not be published. Required fields are marked *