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

The Archive Base Latest Questions

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

Hi i am working on LIME programming which is a subset of javascript. i

  • 0

Hi i am working on LIME programming which is a subset of javascript.

i need to use javascript.splice to remove certain elements from my array, sad to say, LIME does not support splice function.

Any idea how do i create my own function to remove elements from an array?

Thanks for your time.

EDIT: Manage to create a simple function.

function removeElements(array, index)
{
    var tempArray = new Array();
    var counter = 0;

    for(var i = 0; i < array.length; i++)
    {
        if(i != index)
        {
            tempArray[counter] = array[i];
            counter++;
        }
    }
    return tempArray;
}
  • 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-23T09:34:38+00:00Added an answer on May 23, 2026 at 9:34 am

    Array.prototype.splice is fully defined in ECMA-262 §15.4.4.12, so use that as your spec and write one. e.g.

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

    When the splice
    method is called with two or more
    arguments start, deleteCount and
    (optionally) item1, item2, etc., the
    deleteCount elements of the array
    starting at array index start are
    replaced by the arguments item1,
    item2, etc. An Array object containing
    the deleted elements (if any) is
    returned. The following steps are
    taken:…

    You will probably have to create a new array, copy the members up to start from the old array, insert the new members, then copy from start + deleteCount to the end to the new array.

    Edit

    Here is an amended splice, the first I posted was incorrect. This one splices the array passed in and returns the removed members. It looks a bit long but I tried to keep it close to the spec and not assume support for any complex Array methods or even Math.max/min. It can be simplified quite a bit if they are.

    If push isn’t supported, it can be replaced fairly simply too.

    function arraySplice(array, start, deleteCount) {
      var result = [];
      var removed = [];
      var argsLen = arguments.length;
      var arrLen = array.length;
      var i, k;
    
      // Follow spec more or less
      start = parseInt(start, 10);
      deleteCount = parseInt(deleteCount, 10);
    
      // Deal with negative start per spec
      // Don't assume support for Math.min/max
      if (start < 0) {
        start = arrLen + start;
        start = (start > 0)? start : 0;
      } else {
        start = (start < arrLen)? start : arrLen;
      }
    
      // Deal with deleteCount per spec
      if (deleteCount < 0) deleteCount = 0;
    
      if (deleteCount > (arrLen - start)) {
        deleteCount = arrLen - start;
      }
    
      // Copy members up to start
      for (i = 0; i < start; i++) {
        result[i] = array[i];
      }
    
      // Add new elements supplied as args
      for (i = 3; i < argsLen; i++) {
        result.push(arguments[i]);
      }
    
      // Copy removed items to removed array
      for (i = start; i < start + deleteCount; i++) {
        removed.push(array[i]);
      }
    
      // Add those after start + deleteCount
      for (i = start + (deleteCount || 0); i < arrLen; i++) {
        result.push(array[i]);
      }
    
      // Update original array
      array.length = 0;
      i = result.length;
      while (i--) {
        array[i] = result[i];
      }
    
      // Return array of removed elements
      return removed;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with python interactively, it's sometimes necessary to display a result which is some
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
Working on calling a C function from my asm project. I'm trying to push
Working on an extension that use the new experimental devtools apis. How do you
Working in Visual Studio 2008 (C#)... I use a List collection to store instances
I have CustomForm inherited from Form which implements a boolean property named Prop .
Working on a project an need a specific effect on the homepage. When a
Working with COM interop, I can call a managed function from within unmanaged code.
Working in C#, I need to find all local peaks in a List of
Working on THIS Page: newsite.702wedding.com/live/ Can't find where to remove the arrows at the

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.