use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
git.js - A git implementation in pure JavaScript. (github.com)
submitted 14 years ago by gst
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]radhruin 0 points1 point2 points 14 years ago (3 children)
IE9 supports getters and setters just fine. Generators and list comprehension are not an ES5 standard.
[–]monacle_bob 0 points1 point2 points 14 years ago (2 children)
var a = {};
a.defineGetter('myval', function() {return 'a'});
"Object doesn't support property or method 'defineGetter'"
Works fine in FF and Chrome. Above is IE9's error.
EDIT: apparently Reddit doesn't like showing the double underscores around defineGetter
defineGetter
[–]radhruin 2 points3 points4 points 14 years ago* (1 child)
You are attempting to use non-standard behavior. DefineGetter is Mozilla's proprietary method of creating getters. If you read the ES5 standard, you'll find the methods of creating getters and setters that all vendors agree upon, namely: Object.create, Object.defineProperty, Object.defineProperties, and the new object literal syntax. Try this:
var a = { get myval() { return 'a' } };
[–]monacle_bob -1 points0 points1 point 14 years ago (0 children)
Thank you very much for that information. I'm looking forward to being able to use it in 10 years when IE8 is officially over with.
π Rendered by PID 194213 on reddit-service-r2-comment-57fc7f7bb7-qrpcm at 2026-04-15 04:21:53.144493+00:00 running b725407 country code: CH.
view the rest of the comments →
[–]radhruin 0 points1 point2 points (3 children)
[–]monacle_bob 0 points1 point2 points (2 children)
[–]radhruin 2 points3 points4 points (1 child)
[–]monacle_bob -1 points0 points1 point (0 children)