This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
// UI Colors | |
$color-robin : #8FCCCC; | |
$color-vista : #79D1AD; | |
$color-mandy : #e67478; | |
$color-apricot : #ed8864; | |
$color-eastside : #9279c3; | |
// UI Colors Map | |
$ui-colors: ( | |
default : $color-robin , |
This file contains hidden or 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 wisePerson(wiseType, whatToSay) { | |
return 'A wise ' + wiseType + ' once said: "' + whatToSay + '".'; | |
} | |
function shouter(whatToShout) { | |
return whatToShout.toUpperCase() + '!!!'; | |
} | |
function textNormalizer(text) { | |
return text.trim().toLowerCase(); |
This file contains hidden or 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 computeArea(width, height) { | |
return width * height; | |
} | |
function celsToFahr(celsTemp) { | |
return celsTemp*9/5+32; | |
} | |
function fahrToCels(fahrTemp) { | |
return (fahrTemp-32)*(5/9); |
- Creating arrays https://jsbin.com/mikidek/2/edit?js,console
- Adding array items https://jsbin.com/bopobez/2/edit?js,console
- Accessing array items https://jsbin.com/hejape/2/edit?js,console
- Array length and access https://jsbin.com/xorunin/2/edit?js,console
- Array copying I https://jsbin.com/dawocot/2/edit?js,console
- Array copying II https://jsbin.com/celavot/2/edit?js,console
- Squares with map https://jsbin.com/quxavo/edit?js,console
- Sort https://jsbin.com/lozinas/edit?js,console
- Max and min (without sort) https://jsbin.com/kesezu/edit?js,console
- Compute the average https://jsbin.com/popecim/edit?js,console
- FizzBuzz https://jsbin.com/yawurow/edit?js,console
Scope defines the visibility of variables. In JavaScript, variables can be in either global or local scope. Global variables are accissible from anywhere in the application. Local variables declared with a var
keyword are visible only within a function block. Local variables declared with let
keyword are limited further to their respective block, statement or expression
You or another developer can accidentally write code that mutates or overwrites a global variable from a local scope.
JavaScript's strict mode allows the developer to opt-in a more restrictive version of JavaScript. Mistakes that would normally just silently fail, would throw an error in the strict mode.
OlderNewer