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

  • Home
  • SEARCH
  • 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 863895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:23:07+00:00 2026-05-15T09:23:07+00:00

So everyone knows what I mean by implicit methods? They’re like those default properties

  • 0

So everyone knows what I mean by “implicit methods”? They’re like those default properties
from the Windows COM days of yore, where you could type something like

val = obj(arguments)

and it would be interpreted as

val = obj.defaultMethod(arguments)

I just found out JavaScript has the same thing: the default method of a RegExp object
appears to be ‘exec’, as in

/(\w{4})/('yip jump man')[1]
==> jump

This even works when the RegExp object is assigned to a variable, and even when
it’s created with the RegExp constructor, instead of /.../, which is good news
to us fans of referential transparency.

Where is this documented, and/or is it deprecated?

  • 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-15T09:23:08+00:00Added an answer on May 15, 2026 at 9:23 am

    This feature is non-standard, some implementations like the Mozilla (Spidermonkey and Rhino) and the Google Chrome (V8) include it, but I would highly discourage its usage, because it isn’t part of the specification.

    Those implementations make RegExp objects callable, and invoking those objects is equivalent to call the .exec method.

    In Chrome (and Firefox 2.x) even when you use the typeof operator with a RegExp object, you get "function" (because they implement the [[Call]] internal method).

    typeof /foo/ == "function"; // true
    

    Also IMO I don’t see the benefit of using:

    regexp(str);
    

    Versus:

    regexp.exec(str);
    

    This is slightly documented here by Mozilla.

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

Sidebar

Related Questions

So, everyone knows ie9.js (from http://code.google.com/p/ie7-js/ ). It seems to work, but it never
Everyone knows the = sign. SELECT * FROM mytable WHERE column1 = column2; However,
as everyone knows Windows does paths with backslashes where Unix does paths with forward
I think everyone knows this site http://pinterest.com/ and I don't want to create site
Hello everyone I'm trying to work with jboss messaging, does anyone knows the default
What I mean: Everyone knows this method of redirecting stream to output: cout <<
Everyone probably knows what I mean, but to clarify the control would need to:
Everyone knows that: www.example.com/city/new-york is much better than: www.example.com/city?id=43567 Fine, meaningful and human-readable. But
It seems everyone knows about the dumb little but in PhoneGap that doesn't allow
I'm working on an intranet MVC web application, using Fluent NHibernate. As everyone knows,

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.