Guest User

Untitled

a guest
Mar 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="ko">
  3.  
  4. <HEAD>
  5. <meta charset="UTF-8">
  6. <title>>Javascript Promise Test</title>
  7. <script type="text/javascript" src="./jquery-1.9.1.js"></script>
  8.  
  9. <script>
  10.  
  11. $(document).ready(function() {
  12. test1();
  13. //console.log("#############################");
  14. //test2();
  15. });
  16.  
  17. const test1 = () =>{
  18.  
  19. let A = function () {
  20. this.x = function () {
  21. console.log('hello');
  22. };
  23. };
  24. A.x=function() {
  25. console.log('world');
  26. };
  27. //A의 ProtoType Object를 원형으로 생성하기 떄문에 값이 안변한다.
  28. let B = new A();
  29. let C = new A();
  30. B.x();
  31. C.x();
  32. };
  33.  
  34. const test2 = () => {
  35.  
  36. let A = function () { };
  37. A.x=function() {
  38. console.log('hello');
  39. };
  40.  
  41. A.prototype.x = function () {
  42. console.log('world');
  43. };
  44. //A의 ProtoType Object를 원형으로 생성하기 떄문에 값이 변경되었기 떄문에 변경된 값을 기반으로 생성한다.
  45. let B = new A();
  46. let C = new A();
  47. B.x();
  48. C.x();
  49. };
  50. </script>
  51.  
  52. </HEAD>
  53.  
  54. <body>
  55. <div class="app">
  56. </div>
  57. </body>
  58. </html>
Add Comment
Please, Sign In to add comment