Skip to content

Instantly share code, notes, and snippets.

@KelviNosse
Created April 20, 2017 17:27
Show Gist options
  • Save KelviNosse/484e550cac5e3a219f864a59d5dd57ad to your computer and use it in GitHub Desktop.
Save KelviNosse/484e550cac5e3a219f864a59d5dd57ad to your computer and use it in GitHub Desktop.
Basic tutorial for kjchints - code
var i = 1;
while(i<=5){
console.log("Iteracion while: "+i+"\n");
}
for(var i = 1; i<=5; i++){
console.log("Iteracion for: "+i+"\n");
}
<!DOCTYPE html>
<html>
<head>
<title>Oa que tal!</title>
</head>
<body>
<script src="variables.js" type="text/javascript">
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Saludame!</title>
</head>
<body>
<button onclick="Saludar()">SALUDAME PLS!</button>
<p id="saludo"></p>
<script src="saludo.js" type="text/javascript"></script>
</body>
</html>
function Saludar(){
var saludo = "";
var tiempo = new Date().getHours();
if(tiempo < 12){
saludo = "Buenos dias!";
}else if(tiempo < 18){
saludo = "Buenas tardes!";
}else{
saludo = "Buenas noches!";
}
document.getElementById("saludo").innerHTML = saludo;
}
var nombre = "Pony";
document.write("Mi nombre es: "+nombre);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment