JavaScript - Calculate Aspect Ratio

Run Settings
LanguageJavaScript
Language Version
Run Command
function gcd (w, h) { return (h === 0) ? w : gcd (h, w % h); } function getRatio(w, h) { var g = gcd (w, h); console.log(w/g, h/g); } getRatio(1080, 2340); getRatio(1080, 2264);
Editor Settings
Theme
Key bindings
Full width
Lines