JavaScript Array pop()

📔 : Java Script 🔗

pop() function , Array में से last element remove करता है। और removed element को ही return करता है।

JavaScript Array pop() Syntax

array.pop();

  1. array | required : array Array variable है , जिसमे से value remove करनी है।

  2. Return Value : removed element को ही return करता है।


JavaScript Array Example

File : js_array_pop.html

CopyFullscreenClose FullscreenRun
<!DOCTYPE html>
<html>
  <body>
    <script>
      var arr=["PHP" , "jQuery", "Laravel", "AJAX"];
      document.write("Removed element : "+ arr.pop() + "<br>");
      document.write(arr);
    </script>
  </body>
</html>
Output
Removed element : AJAX
PHP,jQuery,Laravel

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.

Get connected with me. :) LinkedIn Twitter Instagram Facebook