Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- /*var miArray = new Array([]);
- var miArray = new Array("Victor",34,true);
- var miArray = [12,45,"array inicializado en su declaración"];
- console.log(typeof miarray);
- var frutas = ["Banana", "Naranja", "Manzana", "Mango"];
- console.log(frutas.valueOf());//muestra el arreglo
- console.log(frutas.toString());//muestra el arreglo en forma d texto
- console.log(frutas.join(" * "));//muestra el arreglo concatenado por *
- console.log(frutas.pop());//saca el ultimo elemento agregado del arreglo
- console.log(frutas);//muestra
- console.log(frutas.push("cereza"));//añade un elemento
- console.log(frutas);//muestra
- a={x:1,y:2};
- console.log(typeof a);
- console.log(a.x);
- console.log(a['y']);
- function A(){
- this.a=10;
- this.b=11;
- }
- var objeto = new A();
- console.log(typeof objeto);
- console.log(objeto.a);
- //a=new A();
- a=new String('asdf');
- console.log(a);
- String.prototype.saludar=function(){
- return 'hola';
- };
- console.log(a.saludar());
- function A(){
- this.a=10;
- this.x=function(){
- return this.a;
- };}
- function B(){this.b=100;}
- B.prototype=new A();
- b=new B();
- console.log(b.x());
- function A(){
- this.f=function(){return 'asdf';};
- }
- a=new A();
- b=Object.create(a);
- console.log(b.f());
- function A(){
- this.x=1;
- this.y=2;
- }
- console.log(Object.keys(new A()));
- var s=new suma();
- s.primervalor(10);
- s.segundovalor(20);
- //La suma de 10 y 20 es : 30*/
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">/*var miArray = new Array([]);
- var miArray = new Array("Victor",34,true);
- var miArray = [12,45,"array inicializado en su declaración"];
- console.log(typeof miarray);
- var frutas = ["Banana", "Naranja", "Manzana", "Mango"];
- console.log(frutas.valueOf());//muestra el arreglo
- console.log(frutas.toString());//muestra el arreglo en forma d texto
- console.log(frutas.join(" * "));//muestra el arreglo concatenado por *
- console.log(frutas.pop());//saca el ultimo elemento agregado del arreglo
- console.log(frutas);//muestra
- console.log(frutas.push("cereza"));//añade un elemento
- console.log(frutas);//muestra
- a={x:1,y:2};
- console.log(typeof a);
- console.log(a.x);
- console.log(a['y']);
- function A(){
- this.a=10;
- this.b=11;
- }
- var objeto = new A();
- console.log(typeof objeto);
- console.log(objeto.a);
- //a=new A();
- a=new String('asdf');
- console.log(a);
- String.prototype.saludar=function(){
- return 'hola';
- };
- console.log(a.saludar());
- function A(){
- this.a=10;
- this.x=function(){
- return this.a;
- };}
- function B(){this.b=100;}
- B.prototype=new A();
- b=new B();
- console.log(b.x());
- function A(){
- this.f=function(){return 'asdf';};
- }
- a=new A();
- b=Object.create(a);
- console.log(b.f());
- function A(){
- this.x=1;
- this.y=2;
- }
- console.log(Object.keys(new A()));
- var s=new suma();
- s.primervalor(10);
- s.segundovalor(20);
- //La suma de 10 y 20 es : 30*/
- </script></body>
- </html>
- <!--<script type="text/javascript" src ="(direccion del archivo de javascript)"/>-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement