Perl and Python influences in JavaScript

[2013-02-24] esnext, dev, javascript, jslang
(Ad, please don’t block)

If you search the Mozilla Central /js/src/.
[Inspiration: a blog post by Ziyun Fei.]

Perl influences in ECMAScript 5

String (jsstr.cpp):
  • String.prototype.match()
  • String.prototype.replace()
  • String.prototype.split()
  • String.prototype.substr()
Array (jsarray.cpp):
  • Array.prototype.join()
  • Array.prototype.reverse()
  • Array.prototype.sort()
  • Array.prototype.push()
  • Array.prototype.pop()
  • Array.prototype.shift()
  • Array.prototype.unshift()
  • Array.prototype.splice()
RegExp (builtin/RegExp.cpp): generally Perl-inspired, one comment attests to that fact.

Python influences in ECMAScript 5

String (jsstr.cpp):
  • String.prototype.concat()
  • String.prototype.slice()
  • String.prototype.match()
Array (jsarray.cpp):
  • Array.prototype.concat()
  • Array.prototype.slice()

ECMAScript 6

ECMAScript 6 was influenced by several languages. Examples:
  • Arrow functions [1] and classes [2] were inspired by CoffeeScript.
  • Generators [3] were inspired by Python.

References

  1. ECMAScript 6: arrow functions and method definitions
  2. ECMAScript 6: classes
  3. Iterators and generators in ECMAScript 6

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant