How to push string in an array in Javascript

You can use push() method on array to push the specific value in Javascript. By using push method you can insert any value at the end of the array.

Answers 1
  • Push string value in an array of number in Javascript

    <script>
    let numArray = [1,2,4,8,9,8];
    numArray.push('Hello');
    console.log(numArray);
    </script>
    
    0

    This code snippet add a string value in an array of numbers.

  • Back to code snippet queries related javascript