Questions tagged [javascript-1.8]

Version 1.8 of the JavaScript language.

JavaScript 1.8 was released in June 2008.

The new features introduced with this version were:

  • Expression closures
  • Generator expressions: allowing developers to simply create generators (introduced in JavaScript 1.7)
  • Array.prototype.reduce()
  • Array.prototype.reduceRight()
4 questions
91
votes
7 answers

Any performance benefit to "locking down" JavaScript objects?

JavaScript 1.8.5 (ECMAScript 5) adds some interesting methods that prevent future modifications of a passed object, with varying degrees of thoroughness: Object.preventExtensions(obj) Object.seal(obj) Object.freeze(obj) Presumably the main point…
callum
  • 34,206
  • 35
  • 106
  • 163
9
votes
2 answers

Explain how a generator is used in this JavaScript code with IndexedDB?

While making my way through the wonderful world of IndexedDB, I came across code like this from Mozilla's test suite: /** * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ var testGenerator…
dumbmatter
  • 9,351
  • 7
  • 41
  • 80
2
votes
2 answers

Is there a library that creates JavaScript 1.8 compatability in all browsers?

Looking through the Mozilla JavaScript site, I see that JavaScript 1.8 has a lot of great functions. In most cases it has code you can add to extend prototypes of the basic types in the case that the function is not implemented on the user's…
Joe
  • 7,922
  • 18
  • 54
  • 83
0
votes
1 answer

Auto create property doesn't work

I am expecting to see: Setting Getting 15 Can someone please explain to me why this code doesn't work? thanks var myObj = new MyObj(); function CreateSimpleProperty(propertyName) { Object.defineProperty(myObj, propertyName, { set:…
Randall Flagg
  • 4,834
  • 9
  • 33
  • 45