Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7648487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:43:39+00:00 2026-05-31T10:43:39+00:00

ES5 added a number of methods to Object , which seem to break the

  • 0

ES5 added a number of methods to Object, which seem to break the semantic consistency of JavaScript.

For instance, prior to this extension, the JavaScript API always revolved around operarting on the object itself;

var arrayLength = [].length;
var firstPosInString = "foo".indexOf("o");

… where as the new Object methods are like;

var obj = { };
Object.defineProperty(obj, {
    value: 'a',
    writable: false
});

… when the following would have been much more conformative:

var obj = { };
obj.defineProperty({
    value: 'a',
    writable: false
});

Can anyone cool my curiosity as to why this is? Is there any code snippets that this would break? Are there any public discussions made by the standards committee as to why they chose this approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:43:41+00:00Added an answer on May 31, 2026 at 10:43 am

    This is all explained very nicely in “Proposed ECMAScript 3.1 Static Object Functions: Use Cases and Rationale” document (pdf) by Allen Wirfs-Brock himself (editor of ES5 spec, and a member of TC39).

    I would suggest to read all of it. It’s pretty short, easily digestible, and gives a nice glimpse of the thought process behind these ES5 additions.

    But to quote relevant section (emphasis mine):

    A number of alternatives API designs were considered before the
    proposed API was chosen. In the course of considering alternatives we
    developed a set of informal guidelines that we applied when
    considering the alternatives. These guidelines are:

    • Cleanly separate the meta and application layers.
    • Try to minimize the API surface area (i.e., the number of methods and the complexity of their arguments).
    • Focus on usability in naming and parameter design.
    • Try to repeatedly apply basic elements of a design.
    • If possible, enable programmers or implementations to statically optimize uses of the API.

    […]

    Here are some of the alternatives that were considered that lead to
    the selected design.

    The obvious initial idea, following the example of the already
    existing standard method Object.prototype.propertyIsEnumerable, was to
    add additional “propertyIs…” query methods on Object.prototype for
    the other attributes and a parallel set of attribute changing methods.

    […]

    As we considered this approach there were a number of things about it
    that we didn’t like and that seemed contrary to the above API design
    guidelines:

    • It merges rather than separates the meta and application layers. As methods on Object.prototype the methods would be part of the public
      interface of every application object
      in a program. As such, they need
      to be understood by every developer, not just library designers.

    […]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which browsers do not support the get and set methods for object prototypes? I
Best reference sites for HTML and JavaScript programming: W3C WebEd Wiki (this site has
Asking about Object.defineProperty as demonstrated below: function testComponent(){ var testProperty; Object.defineProperty(this, testProperty, { get
When I want to call a function in javascript with arguments supplied from elsewhere
What is the recommended way to get a handle to the global object in
Does anyone have any example implementation of making individual object props readOnly/non-configurable? I mean
The Javascript specification specifies four kinds of line terminators. LF , CR , line
i have this table POSITION: CREATE TABLE `position` ( `idposition` bigint(20) NOT NULL AUTO_INCREMENT,
Array.prototype.sort.call(foo); // [object Object] Array.prototype.sort.call(true); // true Array.prototype.sort.call(1); // 1 Array.prototype.sort.call([1]); // [1] Array.prototype.sort.call({});
After reading this description: http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps I'm trying to get a hang of it, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.