Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Get last element in an object using angularjs

$
0
0

How to get the last element in an object?
Example:

$scope.sample =[
{"num" : "1",
{"num": "2",
{"num": "3"}
]
How can I get 3 and add it to 2? In short, how can I get the sum of the last 2 elements in an object?


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>