SHARE
TWEET

Untitled

a guest Mar 24th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const assert = require('assert');
  2.  
  3. class BankCustomer {
  4.     constructor(name, numCb) {
  5.         let firstName = name;
  6.         let carteBleu = numCb;
  7.  
  8.         this.getName = () => {
  9.             console.log(firstName)
  10.             return firstName
  11.         }
  12.  
  13.         this.verifyPinInput = (enterCode) => {
  14.             if (enterCode === carteBleu) {
  15.                 console.log(true)
  16.                 return true;
  17.             }
  18.             else {
  19.                 console.log(false)
  20.                 return false
  21.             }
  22.         }
  23.     }
  24. }
  25.  
  26. // Tests
  27. const customer = new BankCustomer('John Doe', '3579');
  28. assert.equal(typeof customer.getName, 'function');
  29. assert.equal(typeof customer.verifyPinInput, 'function');
  30. assert.equal(customer.getName(), 'John Doe');
  31. assert.ok(customer.verifyPinInput('3579'));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top