Skip to content

Instantly share code, notes, and snippets.

@anastasia
Created October 24, 2014 19:28
Show Gist options
  • Select an option

  • Save anastasia/f8f0c08099d3c826040d to your computer and use it in GitHub Desktop.

Select an option

Save anastasia/f8f0c08099d3c826040d to your computer and use it in GitHub Desktop.
An object with all 16:9 pairs
var findPairs = function() {
var height;
var numPairs = {};
var width = 450;
while (width <= 1280) {
height = width * 9 / 16;
if (!(height % 1) ){
numPairs[width] = height;
}
width += 1;
}
return numPairs;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment