Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Add new element to an array in javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 125
    Comment on it

    Javascript provide us a push() method by using this method we can add new element in to the array.
    Ex:-

    1. var name = ["Amit", "Rohit", "Manoj"]; // existing array with names
    2. name.push("Kapil"); // adding new element

    Output:- name array will looks like : ["Amit", "Rohit", "Manoj","Kapil"]

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: