ruthbasiccalendar
v1.0.8
Published
Calendar of weeks
Downloads
8
Readme
Ruth Basic Calendar
This calendar of week
const weekdays=[
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday'
];
function getWeekdayName(index){
if(index >=0 && index <7){
return weekdays[index];
}
else{
return 'Invalid index';
}
}
console.log(getWeekdayName(5));
console.log(getWeekdayName(2));
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
If this is a brand new project, make sure to create a package.json first with the npm init command.
Installation is done using the npm install command:
npm install ruth_basiccalculator
Features
Error Handling:defining index will help in check user entered correct index of days 2.Readability and maintanability:code is structured well 3.Reusability:The getWeekdayName() function can be reused throughout the program or in other projects to retrieve weekday names based on index