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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:14:18+00:00 2026-06-03T04:14:18+00:00

I am reading JavaScript The Good Parts without prior js knowledge and this bit

  • 0

I am reading JavaScript The Good Parts without prior js knowledge and this bit baffled me. I think I need clarification.

JavaScript allows the basic types of the language to be augmented. In Chapter 3, we saw that adding a method to Object.prototype makes that method available to all objects. This also works for functions, arrays, strings, numbers, regular expressions, and booleans.
For example, by augmenting Function.prototype, we can make a method available to all functions:

Then goes on with this example:

Function.prototype.method = function (name, func) {
     this.prototype[name] = func;
     return this;
};

Now every basic type has a “method” method so new functions can be defined for them, like:

Number.method('integer', function () {
    return Math[this < 0 ? 'ceiling' : 'floor'](this);
});

But the book previously noted everything links to Object not to Function! How is this working out?

  • 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-03T04:14:20+00:00Added an answer on June 3, 2026 at 4:14 am

    No, only functions have Function.prototype. Number is a constructor function so it is “linked” to that prototype.

    Here’s what the nodejs/V8 shell says about Number:

    > Number
    [Function: Number]
    > typeof Number
    'function'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading Javascript: The Good Parts and am totally baffled by what's really going
I'm reading crockford's Javascript: The Good Parts and am messing around with this piece
I just started reading on Douglas Crockford's Javascript The Good parts where he explains
I am currently reading 'Javascript Good Parts', and I came across the following paragraph
I am reading the book Javascript: The good parts. Now I am reading chapter
Reading 'Javascript The good Parts' from Crocksford, I've been in a quest to write
I'm reading Douglas Crockfords Javascript: The Good Parts , I just finished the regular
I remember reading in Douglas Crockford's Javascript the Good Parts book that there is
On Stackers' recommendation, I have been reading Crockford's excellent Javascript: The Good Parts .
I am currently reading the book Javascript: The Good Parts and was playing with

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.