This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = [50, 52, 100, 80, 90, 1000]; | |
var min = 0, diff = 0, currentMin = input[0], currentDiff = 0; | |
for(var i = 0; i < input.length; i++) { | |
var current = input[i]; | |
//checks if this is the lowest point of the graph | |
if(current < currentMin) { | |
currentMin = current; | |
} |