// jQuery
$(document).ready(function() {
// code
})
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
body { | |
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, | |
Ubuntu, Cantarell, Helvetica Neue, sans-serif; | |
} |
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
for( var x=0; x<3; x++){ | |
for( var y=3; y>0; y--){ | |
console.log( y*x); | |
} | |
} | |
//initiate x with 0 | |
//check x < 3 if we can proceed | |
//if so, do the inner loop | |
//initiate y to 3 | |
//check y > 0 if we can proceed |
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
function doImportantStuff() { | |
var someVariable = "important stuff"; | |
function reportImportantStuff() { | |
console.log(someVariable) // "important stuff" | |
} | |
reportImportantStuff(); | |
} |
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
function doImportantStuff() { | |
var someVariable = "important stuff"; | |
console.log(someVariable); // "important stuff" | |
console.log(anotherVariable); // oops can't access that | |
} | |
function anotherImportantStuff() { | |
var anotherVariable = "not so important"; | |
} |
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
function doImportantStuff() { | |
//function scope | |
var someVariable = "important stuff"; | |
} | |
{ | |
//block scope | |
let anotherVariable = "not so important"; | |
} |
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
if(num === 10 || num === "10") { | |
//do someting | |
} | |
if(num == 10) { | |
//do someting | |
} |
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
var val = undefined | |
if(val === undefined || val === null) { | |
//do something | |
} | |
if(val == undefined) { | |
//do something | |
} |
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
license: mit |
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
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
OlderNewer