function printprops(o) { for (let p in o) { console.log(`${p}:${o[p]} \n`) } } function distance(x1, y1, x2, y2) { let dx = x2 - x1; let dy = y2 - y1; return Math.sqrt(dx * dx + dy * dy); } function factorial(x) { if (x <= 1) return 1; return x * factorial(x - 1); } printprops({ a: 1, b: 2, c: { d: 3 } }); console.log('distance', distance(3,0,3,4)); console.log('factorial:',factorial(3));