jQuery Remove Last Element from an Array.

you want to remove last element from an array without any loop. you can remove last element from array without loop. I am explaining you, how to remove last element from an array. let’s see example :

<!DOCTYPE html>
<html>
<head>
   <title>jQuery Remove Last Element from Array </title>
   <script src="https://code.jquery.com/jquery-1.12.3.js"></script>
</head>
<body>  
<script type="text/javascript">
   
    var results = [ "webdeveloperindia.in","pakizacity.com","markdevelopments.com"];
  
    results.pop();
  
    console.log(results);
  
</script>  
</body>
</html>

Result :

['webdeveloperindia.in', 'pakizacity.com']

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 1 =