Skip to content

Instantly share code, notes, and snippets.

View shonnly's full-sized avatar

Shonn Lyga shonnly

View GitHub Profile
%BuildToolsPath%\GitLink.exe c:\git\myLocalGitProjectFolder -u "http://vm-hd87-ug84:8081/api/%var2%/%revision%" -b %branchname% -c debug -powershell -errorsaswarnings
- %BuildToolsPath% is the path to build tools on my build machine.
- %var2% is a placeholder that will be replaced by the file name when debugging. This is the only placeholder that should not be expanded by the build system. It is for the debugger's use only.
- %revision% is the git revision number that should be expanded by the build system to the current revision being built.
- %branchname% should also expand by the build system to the current branch name that is being built.
var obj = {};
obj[Symbol.iterator] = function* () {yield 'Hatfield', yield 'Ulrich', yield 'Hammet'};
console.log(...obj); // Hatfield Ulrich Hammet
var obj = {};
obj[Symbol('name')] = 'Jordan';
console.log(obj); // {Symbol(name): "Jordan"}
Object.keys(obj); // []
var obj = {};
obj[Symbol.for('name')] = 'Jordan';
console.log(obj); // {Symbol(name): "Jordan"}
obj[Symbol.for('name')] = 'Jordan'; // Idempotent? Yes.
console.log(obj); // {Symbol(name): "Jordan"}
var obj = {};
obj[Symbol('name')] = 'Jordan';
console.log(obj); // {Symbol(name): "Jordan"}
obj[Symbol('name')] = 'Jordan'; // Idempotent?
console.log(obj); // {Symbol(name): "Jordan", Symbol(name): "Jordan"}
var s1 = Symbol('foo'); // local symbol for 'foo'
var s2 = Symbol.for('foo'); // global symbol for 'foo'
s1 === s2 // false
var s1 = Symbol.for('s'); // creates a unique Global Symbol
var s2 = Symbol.for('s'); // fetches existing Global Symbol
s1 === s2 // true
var s1 = Symbol('s'); // creates a unique local Symbol (not Global)
var s2 = Symbol.for('s'); // creates Global Symbol instance accessible from anywhere at runtime
s1 === s2 // false
var s = Symbol.for('random_string')
console.log(s); // Symbol(random_string)
var s = Symbol('foo');
Symbol.for('foo'); // Symbol(foo)