Yoshni So‘zlarda Ifodalash

20-69 oralig‘idagi yoshni kiriting → so‘zlarda chiqariladi!

let y = parseInt(document.getElementById("ageInput").value);
let n = Math.floor(y / 10);
const tens = {
  2: ____?____,
  3: 'o\'ttiz',
  4: 'qirq',
  5: 'ellik',
  6: 'oltmish'
};
let m = y % 10;
const ones = {
  1: 'bir',
  2: 'ikki',
  3: ____?____,
  4: 'to\'rt',
  5: 'besh',
  6: 'olti',
  7: 'yetti',
  8: 'sakkiz',
  9: 'to\'qqiz'
};
let bir = ones[m] || '';
let result = (tens[n] || '') + (bir ? ' ' + bir : '') + ' yosh';
document.getElementById("result").textContent = "Yosh: " + result;
  
'yigirma'
'uch'
'qirq'
'besh'