This file contains hidden or 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 isLeap(year){ | |
| if (year % 4 === 0){ | |
| if(year % 100 === 0){ | |
| if (year % 40 === 0){ | |
| return "leap year."; | |
| }else{ | |
| return "not leap year"; | |
| } | |
| }else{ | |
| return "leap year"; |
This file contains hidden or 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 name = prompt ("cual es tu nombre?"); | |
| var firstword = name.slice(0,1); | |
| var mayuscula = firstword.toUpperCase(); | |
| var resto = name.slice(1, name.length); | |
| var resto = resto.toLowerCase(); |
This file contains hidden or 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 bmiCalculator (weight, height){ | |
| // var bmi = weight / Math.pow(height , 2); | |
| // return Math.round(bmi); | |
| // } | |
| // var bmi = bmiCalculator(85, 1.8); | |
| // console.log(bmi); | |
| function calcular(peso, altura){ |
This file contains hidden or 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 bmiCalculator (weight, height){ | |
| // var bmi = weight / Math.pow(height , 2); | |
| // return Math.round(bmi); | |
| // } | |
| // var bmi = bmiCalculator(85, 1.8); | |
| // console.log(bmi); | |
| function calcular(peso, altura){ |
This file contains hidden or 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 output = []; | |
| var count = 1; | |
| function fizzbuzz(){ | |
| for(var i = 1 ; i <= 15; i++){ | |
| if(count % 3 === 0 && count % 5 === 0 ){ | |
| output.push("FizzBazz"); | |
| }else if(count % 3 === 0){ |
This file contains hidden or 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 fibonacciGenerator(n) { | |
| var output = [] | |
| if (n === 1){ | |
| output = [0]; | |
| } | |
| else if(n === 2){ | |
| output = [0, 1]; | |
| } | |
| else{ | |
| output = [0, 1]; |
This file contains hidden or 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 output = []; | |
| var count = 1; | |
| function fizzbuzz(){ | |
| if(count % 3 === 0 && count % 5 === 0){ | |
| output.push("FizzBazz"); | |
| } |
This file contains hidden or 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 lifeInWeeks(age) { | |
| /************Don't change the code above************/ | |
| var age = prompt ("cual es tu edad?"); | |
| var year = prompt ("año a calcular?"); | |
| var weeks = 52; | |
| var days = 365; |
This file contains hidden or 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 sayHello(to){ | |
| // console.log("Hello " + to) | |
| // } | |
| // sayHello("Jhon"); | |
| function otroevento(typeOfEvent, callback){ | |
| var eventthatHappened = { | |
| eventType: "keypress", | |
| key: "p", |
This file contains hidden or 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 bmiCalculator (weight, height) { | |
| var interpretation = weight / Math.pow(height, 2); | |
| return Math.round(interpretation); | |
| } | |
| var body = bmiCalculator(85,1.8); | |
| if(body < 18.5 ){ | |
| console.log("your weight is: " + body + " You are underweight"); | |
| } |