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 8517429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:41:56+00:00 2026-06-11T05:41:56+00:00

Facebook’s JS SDK has recently started using newer ES5 Javascript methods such as Object.keys()

  • 0

Facebook’s JS SDK has recently started using newer ES5 Javascript methods such as Object.keys() and [].map(). They still support older browsers by having an ES5() function that accepts the original object, the name of the desired method, and any parameters. It then runs either the native method or an equivalent JS method if the native one isn’t available. For example:

ES5(g.api.whitelist, 'forEach', true, function(ca) {
    s[ca] = 1;
});

or for top-level objects,

ES5('JSON', 'parse', false, r.responseText);

I suspect that this is the result of a preprocessor, and FB’s devs are actually writing something more along the lines of

g.api.whitelist.forEach(function(ca) {
    s[ca] = 1;
});

and

JSON.parse(r.responseText);

(presumably with longer variable names too)

Now, assuming I’m right that there is a preprocessor, is the ES5() function and associated preprocessed are an open-source project or something in-house? If it’s in-house, can anyone from FB comment on the possibility of open-sourcing it? It’s something that I could find tremendously useful.

  • 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-06-11T05:41:57+00:00Added an answer on June 11, 2026 at 5:41 am

    We are indeed using a preprocessor (based on jspatch) which lets us write regular ES5 code. The ES5 function itself is basically a wrapper around polyfills from MDN and JSON3.

    Not only does this let us write ES5, but it avoids us using faulty implementations of things like Function#bind and JSON.stringify.

    The blog post is now out.

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

Sidebar

Related Questions

Facebook is deprecating FBML and recommending JavaScript SDK (on Graph API) with Social Plugins
Facebook has a special javascript call for setting Fanpage permissions. Unfortunately, I can't get
Facebook recently introduced the Built-in Like as a built-in Open Graph action (see blogpost
facebook has the facebook credit and I knew that they are testing on pay
Facebook has linked accounts, where facebook logs you into facebook everytime you are logged
Downloaded Facebook C# SDK 5.4.1 from here . I've been through the CS-WinForms solution
Facebook has officially launched its Facebook Questions. Does anyone know if it's possible to
Facebook recently added photo-tagging capabilities to its Graph API: http://developers.facebook.com/blog/post/509/ I am using FbConnect
Facebook changed their Graph API recently to require an access token. Therefore I quickly
Facebook supports getting the number of comments on each url by using the following:

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.