Skip to content

Instantly share code, notes, and snippets.

@wackyapps
Created November 27, 2019 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wackyapps/7b386760b591d027d7c597e670001b2d to your computer and use it in GitHub Desktop.
Save wackyapps/7b386760b591d027d7c597e670001b2d to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
/*
Program is set of instructions which executes in memory
of the computer
variable => container in memory which holds some data
for some time
*/
var firstName = "Abdul";
firstName = "Waqas";
firstName = 34;
// string = "waqas" | 'waqas' | '234'
// number = 34 , 34.5
// boolean = true | false;
var sum = 2 + 1;
var sum2 = parseInt("2") + parseInt("2");
var sum3 = parseFloat("3.2345") + parseInt(2);
//document.write(sum);
//document.write(sum2);
//document.write(sum3);
if(sum == 4){
//document.write("True");
}else{
//document.write("False");
}
var isSunnyDay = true;
isSunnyDay = false;
isSunnyDay = 1;
switch(isSunnyDay){
case true:
document.write("Yes, today is a sunny day");
break;
case false:
document.write("No, today is a cloudy day");
break;
case 1:
document.write("At the moment it is nigt");
break;
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">/*
Program is set of instructions which executes in memory
of the computer
variable => container in memory which holds some data
for some time
*/
var firstName = "Abdul";
firstName = "Waqas";
firstName = 34;
// string = "waqas" | 'waqas' | '234'
// number = 34 , 34.5
// boolean = true | false;
var sum = 2 + 1;
var sum2 = parseInt("2") + parseInt("2");
var sum3 = parseFloat("3.2345") + parseInt(2);
//document.write(sum);
//document.write(sum2);
//document.write(sum3);
if(sum == 4){
//document.write("True");
}else{
//document.write("False");
}
var isSunnyDay = true;
isSunnyDay = false;
isSunnyDay = 1;
switch(isSunnyDay){
case true:
document.write("Yes, today is a sunny day");
break;
case false:
document.write("No, today is a cloudy day");
break;
case 1:
document.write("At the moment it is nigt");
break;
}
</script></body>
</html>
/*
Program is set of instructions which executes in memory
of the computer
variable => container in memory which holds some data
for some time
*/
var firstName = "Abdul";
firstName = "Waqas";
firstName = 34;
// string = "waqas" | 'waqas' | '234'
// number = 34 , 34.5
// boolean = true | false;
var sum = 2 + 1;
var sum2 = parseInt("2") + parseInt("2");
var sum3 = parseFloat("3.2345") + parseInt(2);
//document.write(sum);
//document.write(sum2);
//document.write(sum3);
if(sum == 4){
//document.write("True");
}else{
//document.write("False");
}
var isSunnyDay = true;
isSunnyDay = false;
isSunnyDay = 1;
switch(isSunnyDay){
case true:
document.write("Yes, today is a sunny day");
break;
case false:
document.write("No, today is a cloudy day");
break;
case 1:
document.write("At the moment it is nigt");
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment