Giter Site home page Giter Site logo

node-debugger-lab-london-web-082718's Introduction

Debug a Script Lab

Objectives

  1. Use Node built-in debugger by putting statements into a given script to find a problem by using debugger
  2. Launch debugger
  3. Fix the script

Introduction

You've been hired by a major national bank to fix some of their account creation code. Some bugs have crept into the code (as bugs are wont to do). Your job is to fix the issues and make the code functional again.

In this lab, you'll debug a Node script which has some issues.

Instructions

  1. Open account.js then launch it from the command line with node account.
  2. Find the issues
  3. Put some debugger statements in account.js
  4. Launch in debug mode with node debug account
  5. Track the issues
  6. Fix the file. (Hint: there are 3 issues to fix.)
  7. Run test with npm test

Note: In order to debug the exported function in account.js, you'll need to call the function somewhere in that file. Simply add a call to account() at the bottom of the file and your break statements should work. Remove this call before running the tests.

The fixed script should output the following:

Account before opening:  { balance: 0, name: 'Azat Mardan', checking: '1' }
New balance after signup bonus is 250
Account after opening:  { balance: 1250,
  name: 'Azat Mardan',
  checking: '1',
  type: 'checking' }

View node-debugger-lab on Learn.co and start learning to code for free.

node-debugger-lab-london-web-082718's People

Contributors

azat-co avatar victhevenot avatar annjohn avatar pletcher avatar

Watchers

Kevin McAlear avatar  avatar  avatar Belinda Black avatar  avatar Joe Cardarelli avatar Sam Birk avatar Sara Tibbetts avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Jaichitra (JC) Balakrishnan avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar  avatar Lore Dirick avatar Nicolas Marcora avatar Lisa Jiang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.