function timeInArabic(timeInMinutes) { let hours = Math.floor(timeInMinutes / 60); let minutes = timeInMinutes % 60; let timeInArabicStatement = ''; if(hours == 1) {timeInArabicStatement = 'ساعة';} else if (hours == 2) {timeInArabicStatement = ' ساعتان';} else if (hours > 2 && hours < 10) {timeInArabicStatement = hours + ' ساعات';} else if (hours > 10) {timeInArabicStatement = hours + ' ساعة';} if(timeInMinutes % 60 != 0 && hours > 0) timeInArabicStatement += ' و'; if(minutes == 1) {timeInArabicStatement += 'دقيقة';} else if (minutes == 2) {timeInArabicStatement += 'دقيقتان';} else if (minutes > 2 && minutes <= 10) {timeInArabicStatement += ' ' + minutes + ' دقائق';} else if (minutes > 10) {timeInArabicStatement += ' ' + minutes + ' دقيقة';} return timeInArabicStatement; } // example of calling the function console.log(timeInArabic(150));