Advertisement
Guest User

Untitled

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