SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const assert = require('assert');
  2.  
  3.  
  4.  
  5. class BankCustomer {
  6.     constructor (nom,code) {
  7.         this.nom = nom;
  8.         let _code = code;
  9.         this.getCode = () => _code;
  10.  
  11.   }
  12.  
  13.     getName() {
  14.         return this.nom;
  15.     }
  16.     verifyPinInput(pin) {
  17.         return(this.getCode() === pin) ? true : false;
  18.     }
  19.  
  20.  
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. const customer = new BankCustomer('John Doe', '3579');
  29. assert.equal(typeof customer.getName, 'function');
  30. assert.equal(typeof customer.verifyPinInput, 'function');
  31. assert.equal(customer.getName(), 'John Doe');
  32. 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