Skip to content

Instantly share code, notes, and snippets.

@alexmasyukov
Created February 26, 2018 07:24
Show Gist options
  • Save alexmasyukov/dd7e7bb62b1e260a11b065456d50b99b to your computer and use it in GitHub Desktop.
Save alexmasyukov/dd7e7bb62b1e260a11b065456d50b99b to your computer and use it in GitHub Desktop.
compute_sum: if (matrix) {
for(var x = 0; x < matrix.length; x++) {
var row = matrix[x];
if (!row) break compute_sum;
for(var y = 0; y < row.length; y++) {
var cell = row[y];
if (isNaN(cell)) break compute_sum;
sum += cell;
}
}
success = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment