Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Cuaderno JavaScript

node v10.24.1
version: 1.0.0
endpointsharetweet
//escribiendo en la consola console.log("hola, ¿qué tal?")
tipos
typeof(23)
typeof({})
Tipo NUMBER
v=23; console.log(v); typeof(v);
v*3 + 2.57 / 1.32
//para que nos diga el resto hacemos esto 27%5
//hay muchas más operaciones que se pueden hacer con number, Math te da acceso a muchas funciones matemáticas Math.PI + Math.log (123) + Math.sin(23)
Tipo STRING
v="Saludos"; console.log(v); typeof(v);
console.log(v.length); v + "mundo"
Array: Lista de elementos
v=[1,2,4,"str",[3]]; console.log(v); typeof(v);
Usando map
a = [1,4,7,2,5,78]; a.map(Math.sqrt)
boolean
v=true; console.log(v); typeof(v)
object: conjunto de parejas propiedad: valor
v={} v={prop1:"valor1",prop2:"valor 2",prop3:"valor 3"}
Function
v= function(x){ console.log("ejectutando función con argumento" +x); return 2* x; }
v(12)
null
var n=null; console.log(n); typeof(n);
subclases
function Mamifero(name){ this.npatas=4; }
Loading…

no comments

    sign in to comment