peppelorum

Untitled

Mar 22nd, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Solution(lines, trafos) {
  2.     this.lines = lines;
  3.     this.trafos = trafos;
  4.  
  5.     this.total = function(sol) {
  6.         return parseInt(this.lines) + parseInt(this.trafos);
  7.     }
  8. }
  9.  
  10. // Kommer att ge:
  11.  
  12. {
  13.     lines: 2,
  14.     trafos: 3
  15. }
  16.  
  17. // Hur lyckas jag evaluera this.total innan jag returnerar så att resultatet blir:
  18.  
  19. {
  20.     lines: 2,
  21.     trafos: 3,
  22.     total: 5
  23. }
Advertisement
Add Comment
Please, Sign In to add comment