Xah Web Dev Blog 2017-10

Updates of JS tutorial to ES2015, status.

in the past 2 months, the following have been updated to ES2015

  1. Intro to Event-Based Programing
  2. Random Range Function
  3. Round/Truncate Number
  4. Tagged Template String
  5. Object Basics
  6. Array.prototype.forEach
  7. Clone, Deep Copy Object/Array
  8. Array.prototype.slice
  9. SVG Clock
  10. Array-Like Object to Array
  11. Array.prototype.sort
  12. Array.prototype.some
  13. Array.prototype.every
  14. Array.prototype.reduce
  15. Array.prototype.reduceRight
  16. Array.from
  17. Array.prototype.toString
  18. Compare Array Equality
  19. Test Equality of Objects
  20. Sparse Array
  21. Array.prototype.indexOf
  22. Array.prototype.lastIndexOf
  23. Array.prototype.join
  24. Array.prototype.concat
  25. Array Constructor
  26. Array.prototype.flat
  27. Create Array
  28. Random Array Element, Randomize Array
  29. Node.js Tutorial
  30. Understand JS Array
  31. Array Basics
  32. Array.prototype.map
  33. Range Function for Array
  34. Array.prototype.splice
  35. the Set Object Tutorial
  36. Set Object
  37. Set.prototype
  38. Set.prototype.add
  39. Set.prototype.clear
  40. Set.prototype.delete
  41. Set.prototype.has
  42. DOM: Set Node Attribute Value
  43. Function Call, Apply, Bind
  44. Function.prototype.call
  45. Reflect.apply
  46. Function.prototype.apply
  47. Get Max/Min Value of Array
  48. Reflect.getOwnPropertyDescriptor
  49. Reflect.isExtensible
  50. Object.isExtensible
  51. Reflect.preventExtensions
  52. Object.preventExtensions

there are still about 100 pages need to be updated. Mostly remove use of var

then, am going to write a JS ES2015 tutorial for beginner. That is, a ES2015 version of JavaScript Basics

put in a few bucks in my patreon. https://www.patreon.com/xahlee Thank you.

following pages updated to ES2015

  1. Object.keys
  2. Object.getOwnPropertyNames
  3. Object.getOwnPropertySymbols
  4. Reflect.ownKeys
  5. Date Tutorial
  6. Date.now
  7. List Properties

CSS: Text Shadow (updated)

CSS: Round Corners (updated)

revamped many pages at Visual CSS

Why JavaScript is the Suckest Language

JavaScript is truly the suckest language. There's no easy way to test object equality, makes you change algorithms fundamentally.

and JavaScript syntax, is the worst possible. Code written by others is not readable.

why is js syntax unreadable? because

it has function expression, but it does not have the usual function programing languages's design to control it. JS is mostly imperative and prototype OOP, incompatible with function programing. Thus, you have passing function as argument and return function. This feature by itself, if used without fine control, creates incomprehensible code (example: y-combinator). (example: haskell has types, composition, currying, etc, to control complex function semantics.)

And JavaScript syntax is C/Java-like, provides no syntactic support for function programing. The passing function style becomes unreadable quickly. (example: lisp solves syntax problem by almost pure nested parenthesis, and haskell etc provides linear syntax (no parenthesis), and syntax that support semantic features such as currying, lambda, nesting, etc.)

Further, JavaScript design that was trying to emulate Java, created the following entities with exceptionally convoluted semantics.

See also: Test Equality of Objects

been thinking, to fix the js problem by removing some features, we'd gain a lot by,

  1. Ban the keyword function.
  2. Ban the keyword this.
  3. Ban the keyword new.
  4. Ban the use of property key "prototype".
  5. Ban the use of property key "constructor".
  6. Ban the keyword delete. [see Delete operator]
  7. Ban the keyword var.
  8. Ban ==.
js suckest language  50182
js suckest language

the spam trend of past 3 years, is people who email you nicely and elaborately, citing your site and ask you to link to them.

Note, you get that only if your site is popular.

See also: Web Spam, Scam, SEO

and there's a scum job site plorepbqref (rot13 to see name), somehow they can always tell if you clicked their email spam read in gmail.

what's the technique to see if your spam email has been opened? (no click link) I thought Google gmail blocked all tracking gifs and indirected stuff.

JavaScript sort, is fragile, and most complex, convoluted

ECMAScript® 2016 Language Specification#sec-array.prototype.sort

today's js: http://xahlee.info/js/js_array_sort.html