Coding challenge done in Node.js