Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JS Bin</title>
  6. </head>
  7. <body>
  8.  
  9. <script id="jsbin-javascript">
  10. /*var miArray = new Array([]);
  11. var miArray = new Array("Victor",34,true);
  12. var miArray = [12,45,"array inicializado en su declaración"];
  13.  
  14. console.log(typeof miarray);
  15.  
  16. var frutas = ["Banana", "Naranja", "Manzana", "Mango"];
  17. console.log(frutas.valueOf());//muestra el arreglo
  18. console.log(frutas.toString());//muestra el arreglo en forma d texto
  19. console.log(frutas.join(" * "));//muestra el arreglo concatenado por *
  20. console.log(frutas.pop());//saca el ultimo elemento agregado del arreglo
  21. console.log(frutas);//muestra
  22. console.log(frutas.push("cereza"));//añade un elemento
  23. console.log(frutas);//muestra
  24.  
  25.  
  26. a={x:1,y:2};
  27. console.log(typeof a);
  28. console.log(a.x);
  29. console.log(a['y']);
  30.  
  31. function A(){
  32. this.a=10;
  33. this.b=11;
  34. }
  35. var objeto = new A();
  36. console.log(typeof objeto);
  37. console.log(objeto.a);
  38. //a=new A();
  39.  
  40. a=new String('asdf');
  41. console.log(a);
  42. String.prototype.saludar=function(){
  43. return 'hola';
  44. };
  45. console.log(a.saludar());
  46.  
  47. function A(){
  48. this.a=10;
  49. this.x=function(){
  50. return this.a;
  51. };}
  52. function B(){this.b=100;}
  53. B.prototype=new A();
  54. b=new B();
  55. console.log(b.x());
  56.  
  57.  
  58. function A(){
  59. this.f=function(){return 'asdf';};
  60. }
  61. a=new A();
  62. b=Object.create(a);
  63. console.log(b.f());
  64.  
  65. function A(){
  66. this.x=1;
  67. this.y=2;
  68. }
  69. console.log(Object.keys(new A()));
  70.  
  71.  
  72. var s=new suma();
  73. s.primervalor(10);
  74. s.segundovalor(20);
  75. //La suma de 10 y 20 es : 30*/
  76. </script>
  77.  
  78.  
  79.  
  80. <script id="jsbin-source-javascript" type="text/javascript">/*var miArray = new Array([]);
  81. var miArray = new Array("Victor",34,true);
  82. var miArray = [12,45,"array inicializado en su declaración"];
  83.  
  84. console.log(typeof miarray);
  85.  
  86. var frutas = ["Banana", "Naranja", "Manzana", "Mango"];
  87. console.log(frutas.valueOf());//muestra el arreglo
  88. console.log(frutas.toString());//muestra el arreglo en forma d texto
  89. console.log(frutas.join(" * "));//muestra el arreglo concatenado por *
  90. console.log(frutas.pop());//saca el ultimo elemento agregado del arreglo
  91. console.log(frutas);//muestra
  92. console.log(frutas.push("cereza"));//añade un elemento
  93. console.log(frutas);//muestra
  94.  
  95.  
  96. a={x:1,y:2};
  97. console.log(typeof a);
  98. console.log(a.x);
  99. console.log(a['y']);
  100.  
  101. function A(){
  102. this.a=10;
  103. this.b=11;
  104. }
  105. var objeto = new A();
  106. console.log(typeof objeto);
  107. console.log(objeto.a);
  108. //a=new A();
  109.  
  110. a=new String('asdf');
  111. console.log(a);
  112. String.prototype.saludar=function(){
  113. return 'hola';
  114. };
  115. console.log(a.saludar());
  116.  
  117. function A(){
  118. this.a=10;
  119. this.x=function(){
  120. return this.a;
  121. };}
  122. function B(){this.b=100;}
  123. B.prototype=new A();
  124. b=new B();
  125. console.log(b.x());
  126.  
  127.  
  128. function A(){
  129. this.f=function(){return 'asdf';};
  130. }
  131. a=new A();
  132. b=Object.create(a);
  133. console.log(b.f());
  134.  
  135. function A(){
  136. this.x=1;
  137. this.y=2;
  138. }
  139. console.log(Object.keys(new A()));
  140.  
  141.  
  142. var s=new suma();
  143. s.primervalor(10);
  144. s.segundovalor(20);
  145. //La suma de 10 y 20 es : 30*/
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166. </script></body>
  167. </html>
  168.  
  169. <!--<script type="text/javascript" src ="(direccion del archivo de javascript)"/>-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement