← Back to JavaScript exercises

49. GCD

Result appears here
const g=(a,b)=>{while(b)[a,b]=[b,a%b];return a};output.textContent=12*18/g(12,18);