Reputation: 703
Im not quite sure how to do this, or what to google to find the answer...
for (var c in cfd){
if (cfd[c] <= cfd[c+1]) {
nextfunk = ???
}
}
After the for-loop thing I want nextfunk to have the value of the name of the lowest valued cfd.
Thanks.
Upvotes: 1
Views: 98
Reputation: 7821
Since you asked to return it:
var nextfunk;
for (var c in cfd){
if (cfd[c] <= cfd[c+1]) {
nextfunk = c;
}
}
return nextfunk;
Upvotes: 0
Reputation: 172578
Try this:-
for (var c in cfd){
if (cfd[c] <= cfd[c+1]) {
nextfunk = c;
}
}
Upvotes: 1