Skip to Content
Advanced Node.js Development
book

Advanced Node.js Development

by Andrew Mead
March 2018
Intermediate to advanced
592 pages
13h 44m
English
Packt Publishing
Content preview from Advanced Node.js Development

Adding the removeUser, getUser, and getUserList methods

Before we can integrate users into our application, let's go ahead and finish building it out. We have three more methods to add and test. The first one is removeUser, which is going to take an argument, the ID of the user you want to remove. This is also going to return the user that was just removed, so if I remove the user with an ID of 3, I want to get rid of it from the list but I do want to return the object.

We'll leave a little note about that, return user that was removed:

removeUser (id) { 
  //return user that was removed 
} 

Now the next method that we're going to be filling out is getUser. The getUser method is going to take the exact same arguments as removeUser. We're going ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Node.js Development

Learning Node.js Development

Andrew Mead
Serverless Applications with Node.js

Serverless Applications with Node.js

Aleksandar Simovic, Slobodan Stojanovic
Node.js: Tools & Skills, 2nd Edition

Node.js: Tools & Skills, 2nd Edition

James Hibbard, Michael Wanyoike, Nilson Jacques, Jay Raj, Manjunath M
Your First Week With Node.js, 2nd Edition

Your First Week With Node.js, 2nd Edition

James Hibbard, Craig Buckler, Mark Brown, Nilson Jacques, James Kolce, Paul Orac, M. David Green, Florian Rappl

Publisher Resources

ISBN: 9781788393935Supplemental Content