SHARE
TWEET

Untitled

a guest Apr 18th, 2019 69 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, code){
  5.         let firstName = name;
  6.         let pin = code;
  7.         this.getName= () =>{return firstName}
  8.         this.verifyPinInput=(input)=>{
  9.             if (pin===input){
  10.                 return true;
  11.             }else{
  12.                 return false;
  13.             }
  14.         }
  15.  
  16.     }
  17. }
  18.  
  19.  
  20. // Tests
  21. const customer = new BankCustomer('John Doe', '3579');
  22. assert.equal(typeof customer.getName, 'function');
  23. assert.equal(typeof customer.verifyPinInput, 'function');
  24. assert.equal(customer.getName(), 'John Doe');
  25. assert.ok(customer.verifyPinInput('3579'));
  26.  
  27.  
  28. console.log(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