Guest User

Untitled

a guest
Apr 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. var total = 0;
  12.  
  13. var scorePoint = function () {
  14. var total = 0;
  15. total += 1;
  16. console.log(total);
  17. };
  18.  
  19. scorePoint();
  20. scorePoint();
  21. scorePoint();
  22. </script>
  23.  
  24.  
  25.  
  26. <script id="jsbin-source-javascript" type="text/javascript">var total = 0;
  27.  
  28. var scorePoint = function () {
  29. var total = 0;
  30. total += 1;
  31. console.log(total);
  32. };
  33.  
  34. scorePoint();
  35. scorePoint();
  36. scorePoint();
  37. </script></body>
  38. </html>
Add Comment
Please, Sign In to add comment