What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://npmjs.org/install.sh | sh |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Alex Kloss <[email protected]> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| function r(f){/in/.test(document.readyState)?setTimeout('r('+f+')',9):f()} |
| console.log(extractTagNamesES5('<a> and <b> or <c>')); // [ 'a', 'b', 'c' ] | |
| // If exec() is invoked on a regular expression whose flag /g is set | |
| // then the regular expression is abused as an iterator: | |
| // Its property `lastIndex` tracks how far along the iteration is | |
| // and must be reset. It also means that the regular expression can’t be frozen. | |
| var regexES5 = /<(.*?)>/g; | |
| function extractTagNamesES5(str) { | |
| regexES5.lastIndex = 0; // to be safe | |
| var results = []; |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| function formatUSprice(amount) | |
| { | |
| var i = parseFloat(amount); | |
| if(isNaN(i)) { i = 0.00; } | |
| var minus = ''; | |
| if(i < 0) { minus = '-'; } | |
| i = Math.abs(i); | |
| i = parseInt((i + .005) * 100); | |
| i = i / 100; | |
| s = new String(i); |
| function AssertionError(msg) { | |
| this.message = msg || ""; | |
| this.name = "AssertionError"; | |
| } | |
| AssertionError.prototype = Error.prototype; | |
| /* Call assert(cond, description1, ...) | |
| An AssertionError will be thrown if the cond is false. All parameters will be logged to the console, | |
| and be part of the error. | |
| */ |