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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:36:26+00:00 2026-05-30T11:36:26+00:00

In the context of inside a function, here’s the code (based on the standard

  • 0

In the context of inside a function, here’s the code (based on the standard pattern of making a function’s ‘arguments’ into an array):

var args = Array.prototype.slice.call(arguments);

I’m trying to study this out (am a beginner at JavaScript, coming from C#).

I understand that slice is an instance method due to it being a prototype function of Array.

I also understand that this is not a static ‘utility function’, meaning to use it, you have to new it up like so: (example) var myArray = new Array(); myArray.slice(...);

call passes an object in here to change the context to that of arguments

Related to this, I don’t also know the difference between
Array.prototype.slice.call([32,32,121,412]) and Array.prototype.slice([32,32,121,412]) not in the context of call.

So, here’s my question:

I just don’t get how this works in relation to instance vs static methods… so can anyone explain the intricacies of var args = Array.prototype.slice.call(arguments);?

Why can this be used without calling new?

Why was this possible? It’s not a Static method, and it must be ‘newed’ up, and it only works when you use call function… (at least in my C# mentality…)

  • 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-30T11:36:28+00:00Added an answer on May 30, 2026 at 11:36 am

    Unlike C#/Java, functions are actually first-class citizens in JavaScript.

    In a general sense:

    This means there is no need to “new” it up.. it works exactly as it is because it is its own object.

    “new”ing up a function (in a general sense) merely changes the ‘this’ value of that function to the variable it will be assigned to, then returns it.

    It is possible to use a function in JavaScript without “newing” it up because they are “first-class citizens” in JavaScript.

    In a more in-depth sense, this is what “new” does:

    – it creates a new object deriving from MyConstructor.prototype

    – it assigns the ‘this’ value of the constructor function to the new object

    – execute the code inside (adds properties to new object/instance)

    – returns the new object

    Some extra notes about what I learned from instances:

    – they don’t have a .prototype property like their constructor functions

    – though they have a [[prototype]] property, derived from MyConstructor.prototype

    – overriding a property in the instance shadows the MyConstructor.prototype[property]..

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

Sidebar

Related Questions

I got the following code inside an NSTimer selector: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:2.0];
Here are two samples of js code: A. function _foo is defined within the
Working inside the context of an ASP.NET application I am creating a page that
Context I am storing a java.util.List inside ehcache. Key(String) --> List<UserDetail> The ordered List
Compare: if (myVariable) { doSomething() } function doSomething () { // Work goes here
What do I need to do to call $this->two() from inside my function innerOne?
When searching code for strings, I constantly run into the problem that I get
I have the following: var o = {f: function(fn) { fn.call(o); }}; var ob
Here's some code from Richard Jones' Blog : with gui.vertical: text = gui.label('hello!') items
I have these Javascript classes/code: function PageManager () { this.digital_channels = undefined; this.loadConfiguration =

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.