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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:56:57+00:00 2026-05-27T05:56:57+00:00

I have some simple code you can see in my fiddle . It alerts

  • 0

I have some simple code you can see in my fiddle. It alerts properly in all browsers and IE9, but not IE8 or 7.

var func = function( x ) {
    var slice = [].slice,
        args = slice.call( arguments ),
        pass = args.splice(1);

    alert( pass );

};

func( 'a', 1, 2 );

EDIT
Using the solution I posted what I used here:
http://jsfiddle.net/7kXxX/4/

I am using this in a case where I don’t know how many arguments are coming, which is why I’m using “arguments”

  • 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-27T05:56:58+00:00Added an answer on May 27, 2026 at 5:56 am

    The ECMAScript 3rd edition standard requires the second deleteCount argument:

    Array.prototype.splice(start, deleteCount [, item1 [, item2[,...]]])
    

    MSDN docs show that IE follows this standard:

    arrayObj.splice(start, deleteCount, [item1[, item2[, . . . [,itemN]]]])
    

    Firefox’s SpiderMonkey allows the second argument to be optional (as do other modern browsers):

    array.splice(index , howMany[, element1[, ...[, elementN]]])
    array.splice(index[, howMany[, element1[, ...[, elementN]]]])
    

    Description:

    howMany
    An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you
    should specify at least one new element. If no howMany parameter is
    specified (second syntax above, which is a SpiderMonkey extension),
    all elements after index are removed.

    Sources:

    • http://bclary.com/2004/11/07/#a-15.4.4.12
    • http://msdn.microsoft.com/en-us/library/wctc5k7s%28v=VS.85%29.aspx
    • https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very simple code below that I can't get to validate on
i have some simple Export/Import Scenario that i can't figur out why this not
simple question maybe but can't find solution. I have button for refresh/update some contents
I have some very simple code to generate an assembly and invoke a method
I have some VERY simple code to return the title for a section header:
I have some code I've written in PHP for consuming our simple webservice, which
Currently, I have some basic code to play a simple tone whenever a button
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a fairly simple const struct in some C code that simply holds
Question simple and quick: I have started to use Netbeans to write some code

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.