Xah Web Dev Blog Archive 2015-07
this Binding (major update. Added a section on the purpose)
Google gmail's spam box is now deciding what you should see. This from Linux Torvalds. https://plus.google.com/+LinusTorvalds/posts/DiG9qANf5PA
minor update JavaScript: Load Order, defer, async, module
JavaScript Fun with new, null, null char, β¦
new; // syntax error. keyword βnewβ must be followed by a expression x[new] = 22; // syntax error. keyword βnewβ must be followed by a expression x."new" = 11; // syntax error. dot notation can't start with quote x.new = 7; // valid. new is converted to a string "\x00" // valid. a string with a null char. var x = { null: 3 }; // valid. null is converted to string here var x = { new: 2 }; // valid. new is converted to string here var x = { "\x00": 4}; // valid. string with a null char, as property key var x = { "p": null }; // valid. property value can be any value.
Deferred Loading JavaScript for Old Browser (minor update)
find nesting depth of a element
// find nesting depth of a element function getDepth (ele) { var dp = 0; while ( ele.parentNode !== null ) { ele = ele.parentNode; dp++; } return dp; }
2015 Features First draft.
ES2015 Language Specification β ECMA-262 6th Edition Now with collapsible table of contents.
Brendan Eich, inventor of JavaScript, turns out, is not a good presenter, nor is he a good blogger.

JavaScript: Array-Like Object to Array (major update)
// js quiz. what does it return "toString" in {p:3}
answer: Access Property
Get Property, Set Property (new. on its own page)
Create/Delete Property (new. on its own page)
Property Overview (new)
JavaScript quiz: property name with space
var x={"a b": 8}; x["a b"]; x[a b]; x."a b";
Prototype and Inheritance (major update. Added standard object inheritance hierarchy.)
JavaScript object's __proto__
property for getting parent is now officially blessed by ES2015.
Get/Set Prototype