Created
March 5, 2017 10:36
-
-
Save thedeveloperr/f428b9ab238267a2e87e1abc631e410c to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> JS practice Session</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var a = 10; | |
var b = 20.5; | |
var c = "Hello"; | |
d = "World"; | |
//Input - Output | |
console.log(a+b); | |
console.log(c+d); | |
name = prompt("Enetr your name"); | |
console.log(name); | |
alert("Game over"); | |
// fun(); | |
// functions in javascript | |
function fun(sub1,sub2="Javascript") { | |
console.log("I am learning "+sub1+", "+sub2); | |
return "done"; | |
} | |
fun("Maths"); | |
//fun("Game dev", "HTML"); | |
//fun2() | |
var fun2 = function(){ | |
console.log("I am an anonymous function."); | |
} | |
fun2(); | |
function playWithArray(){ | |
arr = [3,5,4,"Number"]; | |
arr.push(6); | |
arr.push(7); | |
for (var i = 0; i<arr.length;i++){ | |
console.log(arr[i]); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment