ruthbasiccalendar

1.0.8 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i ruthbasiccalendar

Weekly Downloads

1

Version

1.0.8

License

ISC

Unpacked Size

1.9 kB

Total Files

4

Last publish

Collaborators

  • umwizerwa