This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Calculadora Porcentaje*/ | |
var t = prompt('ingresa algo'); | |
function aPorcentaje(num) { | |
var a = num; | |
var result = a / 12 * 100 | |
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var question = prompt('Ingresa la cantidad'); | |
var question_Two = prompt('Data'); | |
function redondeo(cantidad) { | |
var a = cantidad; | |
return a; | |
} | |
function nacidos(cantidad, vivos, fallecidos) { | |
var a = cantidad; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var xhr = new XMLHttpRequest; | |
var API = "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch"; | |
var SEARCH = prompt("Que vas a buscar?"); | |
xhr.onreadystatechange = function(){ | |
if (xhr.readyState == 4 && xhr.status == 200) { | |
JSON.parse(xhr.responseText); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search(dni) { | |
var save = {}; | |
var a = dni; | |
save = a; | |
var b = prompt("ingresa el dni"); | |
if(typeof save == toString()) { | |
return "hola"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toMatch(string) { | |
var eString = string; | |
var toExpression = /[A-Z]/gi; | |
var result; | |
var match = eString.match(toExpression); | |
var i = 0; | |
while(i < match.length) { | |
console.log(i); | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Less pro by edinson carranza | |
@varUno: blue; | |
@varDos: green; | |
* { | |
box-sizing: border-box; | |
} | |
//Añadimiento normal en less | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//javascript object in function | |
//cv in jss | |
var question = prompt('ingresa el nombre'); | |
var micv = { | |
nombre: 'Edinson', | |
surname: 'Carranza', | |
form: function(city){ | |
var title = "Soy de: "; | |
return title + city; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Map in javascripts | |
//map se pasa 3 parametros - currentValue, Index, Arr | |
function mapOne(){ | |
var miArray = [1, 2, 3]; | |
var incremento = 1; | |
miArray.map(function(multiplicar, indice, array){ | |
console.log('Muestro el indice de mi array' + indice); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//toDatestring | |
function toDate(data) { | |
var data = new Date(2016, 25, 06); | |
return data.toDateString(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//'use strict'; | |
var http = require('http'); | |
var puerto = '3000'; | |
http.createServer(function(req, res){ | |
//respondemos nuestro head con el status | |
res.writeHead(200, {'Content-type': 'text/html'}); | |
res.end('<h1>Hello Nodejs</h1>'); | |
}).listen(puerto, function(){ | |
console.log('esta corriendo server ' + puerto) |