- What are the primitive/native types exist?
- Which built-in prototypes exist?
- What is the difference between a primitive and complex type?
- Which primitives have corresponding objects?
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
Show hidden characters
{ | |
"globals": { | |
"console": false, | |
"debug" : false, | |
"jQuery" : false | |
}, | |
"camelcase" : true, | |
"curly": true, | |
"eqeqeq": true, |
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
Directories: | |
* 0-settings | |
* 1-tools | |
* 2-generic | |
* 3-base | |
* 4-objects | |
* 5-gui | |
* 6-trump |
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
// EventEmitter pattern: https://www.joyent.com/developers/node/design#EventEmitter | |
var EventEmitter = require('events').EventEmitter; | |
var utils = require('utils'); | |
function Controller() { | |
if (!(this instanceof Controller)) return new Controller(); | |
EventEmitter.call(this); | |
} |
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
// It is expected that `order` and `items` have the same length | |
// and that all key values in items exist in order | |
// Order according to | |
var order = [ 'charlie', 'delta', 'quebec', 'foxtrott' ]; | |
// Needs re-ordering | |
var items = [ | |
{ key: 'charlie' }, | |
{ key: 'delta' }, | |
{ key: 'foxtrott' }, // not in order |
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
// add n amount of arguments together | |
function add() { | |
var sum = 0; | |
var i; | |
var len = arguments.length; | |
for (i = 0; i < len; i++) { | |
sum += Number(arguments[i]); | |
} | |
return sum; | |
} |
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
// https://de.wikipedia.org/wiki/Gr%C3%B6%C3%9Fter_gemeinsamer_Teiler | |
function gcd(a, b) { | |
return b === 0 ? a : gcd(b, a % b); | |
} | |
// https://de.wikipedia.org/wiki/Kleinstes_gemeinsames_Vielfaches | |
function lcd(a, b) { | |
return (a * b) / gcd(a, b); | |
} |
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 thousands(value) { | |
var SIZE = 3; | |
var parts = String(value).split('.'); | |
var number = parts[0]; | |
var dec = parts.length === 2 ? '.' + parts[1] : '' | |
var formatted = ''; | |
var i; | |
var len = number.length; | |
for (i = 0; i < len; i++) { | |
if (len > SIZE && i > 0 && !((len - i) % SIZE)) { |
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 strict"; | |
var shell = require("shelljs"); | |
var fs = require("fs"); | |
var pjson = JSON.parse(fs.readFileSync("./package.json"), "utf8"); | |
function printDependencies(deps) { | |
Object.keys(deps).forEach(function (name) { | |
console.log(name, deps[name].version + " --> " + deps[name].latest); |
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
console.clear(); | |
var obj = { | |
namespace: { | |
foo: "123" | |
} | |
}; | |
function getPropVal(obj, prop) { | |
var levels = prop.split("."); | |
if (levels.length === 1) { return obj[levels[0]]; } |
OlderNewer