Skip to content

Instantly share code, notes, and snippets.

View oliversd's full-sized avatar

Olivers De Abreu oliversd

View GitHub Profile
const speedOfLight=299792458; //m*s-1
try {
 speedOfLight=300; // this is not true!
} catch(error) {
 console.log(error); // TypeError: Assignment to constant variable.
 // Note - error messages will vary depending on browser
}
console.log(speedOfLight); // Expected output 299792458
let date = new Date("2015–01–01");
let region = "US";
// Some were further in the code
if (region === "US") {
 let date = new Date();
 console.log("New date", date); // We get the current date as expected
}
console.log(date); //We get 2015–01–01T00:00:00.000Z as expected :)
var date = new Date("2015–01–01");
var region = "US";
// Some were further in the code
if (region === "US") {
 var date = new Date();
 console.log("New date", date); // We get the current date as expected
}
console.log(date); //Expecting 2015–01–01T00:00:00.000Z but we get the current date
@oliversd
oliversd / index-uikit.html
Created September 3, 2013 16:15
Esqueleto HTML para uikit
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/uikit.min.css" />
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>