JavaScript Array push()

📔 : Java Script 🔗

push() method का use Array में new element को insert करने के लिए किया जाता है। New element Array के end में insert होता है।

JavaScript array push() Syntax

array.push(element1, element2, ... , elementn);

Parameters
  1. element | required : Array में insert की जाने वाली value है। आप एक साथ कई elements को insert कर सकते हैं।

  2. Return Value : element(s) insert करने के बाद Array की length return करता है।


JavaScript array push() Example

File : js_array_push.html

CopyFullscreenClose FullscreenRun
<!DOCTYPE html>
<html>
  <body>
    <script>
      var arr=["PHP" , "jQuery"];
	  arr.push("JavaScript");
      document.writeln(arr);
    </script>
  </body>
</html>
Output
PHP,jQuery,JavaScript

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook