Skip to content

Instantly share code, notes, and snippets.

@numbnet
Created February 8, 2021 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numbnet/fa861132c074ee21f3d91d1d0677c5c8 to your computer and use it in GitHub Desktop.
Save numbnet/fa861132c074ee21f3d91d1d0677c5c8 to your computer and use it in GitHub Desktop.
JS
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Array Methods</h2>
<h2>push()</h2>
<p>The push() method returns the new array length.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo1"></p>
<p id="demo2"></p>
<script>
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo1").innerHTML = fruits;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment