Skip to content
Permalink
Browse files
Completed Lab Sheet
Minor amendments were needed
  • Loading branch information
aa7401 committed Oct 12, 2019
1 parent 9629baa commit c0aa4ed9f582fc3748e4f3bf7e75b9e14389ab86
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 70 deletions.
@@ -108,6 +108,8 @@ $ ./node_modules/.bin/jsdoc -d ./docs/jsdoc/ modules/*

If you run this command you should see a new directory called `docs/` which will contain a `jsdoc/` directory. Inside this you will see some website files, opening the `index.html` file in your browser you should see the documentation pages for your website!

![JSDoc Documentation](exercises/.images/jsdoc.png)

### 4.1 Test Your Understanding

You will probably have noticed that only a couple of the functions include complete JSDoc comments and so the documentation website is incomplete. Your task is to use the existing comments for guidance and complete the task of documenting your code. You will find the [JSDoc](http://usejsdoc.org) and [jsdoc-route-plugin](https://www.npmjs.com/package/jsdoc-route-plugin) documentation helpful.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

@@ -2,7 +2,7 @@
/**
* Class representing a list of items.
* */
module.exports = class List {
class List {

/**
* Create a list.
@@ -29,20 +29,17 @@ module.exports = class List {
return this.items.map( (element, index) => ({key: index, item: element.item, qty: element.qty}));
}

/**
* Delete a single item.
* @param {Number} id - The index to be deleted.
*/
delete(id){
this.items.splice(id, 1);
}

/**
* Return the number of items in the list.
* @return {Number} The number of items.
*/
count(){
return this.items.count;
}

}

// exporting the class by name adds the name to the documentation
module.exports = {
List
}

0 comments on commit c0aa4ed

Please sign in to comment.