Xah Web Dev Blog Archive 2017-02

String.fromCodePoint New in JS2015. Now working with Unicode emoji is much easier.

Property Key “constructor” (updated)

  1. the issue with font is that, ① if you care that your site look EXACTLY the same in diff browsers/OSes. ② if you mind a web font download.
  2. caring for exact look across is not just esthetics. example: when you have iframe. scroll bar may or may not appear, depending on font used.
  3. If you want pixel-exact look, then solution is easy. Use Arial, Courier New. They are on both Windows, Mac, but not linux.
  4. there's no general solution for pixel-exact look across Windows, Mac, Linux, without requiring download (i.e. web font).
  5. if you don't mind requiring user download, then Google web font Roboto & Arimo for sans are excellent solution.
  6. If you chose a popular Google webfont such as Roboto, it's almost already cached, so no cost for site load time.
  7. but the problem with web fonts is that, it requires a network connection. Your site can no longer serve as portable book in HTML format.
  8. vast majority of websites do not use web font. And Arial is probably still the most used font on web sites.
  9. Google Search is using Roboto, and YouTube and Google Plus. Probably all Google sites.
  10. Twitter, StackOverflow, Wikipedia, seem to default to local fonts. They use sans-serif, most popular are Arial, Georgia, Verdana.
  11. nytimes, washington post, forbes, use local font, Georgia. US Today is Arial.
  12. wsj uses its own proprietary webfont, serif.
  13. Time Mag uses proprietary webfont, serif. “Duplicate Iconic”
  14. New Yorker, always the snobby one, uses proprietary webfont, serif. “TNY Adobe Caslon Pro”
  15. ok, that concludes today's Xah Edu Corner, episode №20170225155325, 〈tech geeking and trifles of font〉.

Regex Functions
(updated for ES2015)

RegExp Syntax (updated for ES2015)

Get/Set Prototype (updated for ES2015)

JavaScript Object Ontology!

JavaScript es2015 objects ontology
JavaScript Object Ontology!

JavaScript regex is modeled after perl5 by spec, but it doesn't have the decency to name it regex instead of regexp.

video format support

as of 2017-02-22

on Windows
Google ChromeFirefoxedge
on Linux
Google Chrome Firefox

Xah JavaScript in Depth, New Version Out

New version is out. Update sent to previous buyers.

If you don't have it, check it out. Link to it, tell friends, buy it. Thanks.

Source Code Encoding (new page on its own. updated for ES2015)

Object.prototype.toString (new page)

Determine Type of Object (major rewrite)

Prevent Adding Property (updated for ES2015)

Delete operator (new page, on its own)

Property Descriptor (new page, on its own) And all pages about property are updated for ES2015.

Property Key, updated to ES2015.

Property Overview (in depth). Updated to ES2015.

Access Property (updated for ES2015)

Compatible Fonts for Linux and Windows

Font is a major pain.

here's a tip to solve diff font on diff OS problem, if you don't want to use Google web font that require users download.

they have the same metrics.

The Liberation fonts are on Linux. The Arial and stuff are available on Microsoft Windows 10 and Mac.

[see Meaning of Font Size]

See also: Best Unicode Fonts for Programer

Firefox is sucking major ass in everyway. for some reason, on window 10 intel i5 cpu, it's still installing 32 bits.

node.js bug. Object.setPrototypeOf returns wrong thing

// node.js bug. this should print “Object {}” but prints “Function {}”
console.log( Object.setPrototypeOf ( {}, Array ) );

Convert Object to/from Map 🚀 (new)

following pages all updated. Each methods on its own page.

Map.prototype.forEach (new standalone page.)

Iterate Over Map Object (new standalone page.)

wow, building javascript spec requires installing 111 packages.

build js spec 2017 02 01

JavaScript ECMA2016 is Released in 2016 June

very odd. JavaScript Array.prototype.includes is not in the spec at http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.indexof but is in spec here https://tc39.github.io/ecma262/2016/#sec-array.prototype.includes

oh wow. Found answer. JavaScript Array.prototype.includes is not in ECMA2015 because it is in ECMA2016, and it's already out! ECMA2016 is released in 2016 June.