Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. const assert = require('assert');
  2.  
  3.  
  4. class BankCustomer{
  5.  
  6. constructor(name, pin){
  7. let secretName = name
  8. let secretPin = pin
  9. this.getName = () => secretName
  10. this.verifyPinInput = (pin) => secretPin === pin;
  11. }
  12. }
  13.  
  14.  
  15.  
  16. const customer = new BankCustomer('John Doe', '3579');
  17. assert.equal(typeof customer.getName, 'function');
  18. assert.equal(typeof customer.verifyPinInput, 'function');
  19. assert.equal(customer.getName(), 'John Doe');
  20. assert.ok(customer.verifyPinInput('3579'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement