Skip to content

Instantly share code, notes, and snippets.

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;
}