thank bro ^^ done
Get just latest info from an api.
-
So let's say for arguments sake, I had a json api with a list of version numbers, how would I get the data from just the latest version (for example 0.1.13, but all versions are listed).
I know you'd do [0] for the first. But is there a way of grabbing the last?
-
var a = [1,2,3]; a[0]; // 1 a[a.length-1]; //3
Keep in mind, if the versioning is in no particular order, or randomised, then you'll have to actually run it through
.sort()
first, too. -
@julian it's in order. Thanking you. Will see if I can put that into production.
Suggested Topics
-
Unsolved Plugins for admin APIs
NodeBB Plugins • • Ankit Kumar
Copyright © 2022 NodeBB | Contributors