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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:13:44+00:00 2026-06-14T02:13:44+00:00

I have a small script that looks like this: hideElements = arguments.shift().split ( ‘,’

  • 0

I have a small script that looks like this:

hideElements = arguments.shift().split ( ',' );
for ( iterator in hideElements ) { 
    console.log ('  --> hiding ' + hideElements[iterator] );
    lg_transitions ( {kind:"slide-up"} , { target : hideElements[iterator] } );
}

When I run it in the debugger all things start quite rationally. I put a breakpoint at the first line listed above. After pressing the “step over next function call” button to initialise the “hideElements” variable to the following:

enter image description here

This is what is what I would have expected but then after completing the first (and should be the only) iteration it comes back to the head of the loop and the “iterator” which had started at 0 has now strangely changed to “remove”. Huh? No idea where that came from. But in the console.log message that follows there might be a hint … it prints the following to the console:

enter image description here

This is a function called — you guessed it — “remove”. It is a function that I added recently for a different reason but it is not called directly or indirectly and so I’m at a loss as to why this would be picked up here. For anyone interested in the full code for “remove”, here it is:

// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function(from, to) {
   var rest = this.slice((to || from) + 1 || this.length);
   this.length = from < 0 ? this.length + from : from;
   return this.push.apply(this, rest);
}

ADDITION:

The code I had neglected to add earlier was the initialisation of the arguments array. Here’s what I had (note I’ve since changed the name to “args” instead of arguments):

function ConditionalFormatting ( key , eventObject , setOfRules ) {
console.log ("Entering conditional formatting: key is " + key + ", eventObject is " + eventObject.attr('id') + ", setOfRules is " + setOfRules );
var ruleStrings = [];
ruleStrings = setOfRules.split (';');
var targetOverride = false;
jQuery.each ( ruleStrings , function ( i , ruleString ) {
    // There is a rule, now let's find out which one
    var targetElement;
    var args = [];
    args = ruleString.split('::');
    var rule = args.shift();
  • 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-14T02:13:45+00:00Added an answer on June 14, 2026 at 2:13 am

    The arguments object is not an actual array. Therefore it doesn’t have the shift() function. If you want the first object in the array, obtain the element at index 0 (first object). Moreover, use a regular for loop to traverse the arguments object.

    hideElements = arguments[0].split(',');
    
    for ( var i = 0; i < hideElements.length; i++ ) {
        ...
    }
    

    arguments is not a real array, however, if you wish to use it like it were an array, then use Array.prototype.slice.call( arguments );:

    if ( arguments.length > 0)
        hideElements = Array.prototype.slice.call( arguments ).shift();
    

    From there on you can use hideElements as an array.

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

Sidebar

Related Questions

I have this small PHP script that takes a POST variable and writes it
I have a small script that I am try to port to work for
I have a small script that reads a file. After reading a line i'm
I have a small cgi script that fetches and validates a configuration file for
I have a python script running on a small server that is called in
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a simple web page which looks like this. When clicked on the
I have a small helper app that I use to inject scripts into html
I have small script in bash, which is generating graphs via gnuplot. Everything works
I have a small script where you can drag the link, but I also

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.