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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:33:53+00:00 2026-05-17T01:33:53+00:00

I have for example this array (each number is singolar, no one duplicate) called

  • 0

I have for example this array (each number is singolar, no one duplicate) called pvalue : 1 2 3 15 20 12 14 18 7 8 (sizeof 10).

I need for example to pop the value “15”, and after this pvalue should be 1 2 3 20 12 14 18 7 8 (sizeof 9). How can do it?

the pop() function take the value at the end of the array. I don’t want this 🙂
cheers

EDIT

for(i=0; i<pvalue.length; i++) {
    if(pvalue[i]==param) {
        ind=i;
        break;
    }
}
pvalue.splice(ind, 1);
  • 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-17T01:33:53+00:00Added an answer on May 17, 2026 at 1:33 am

    You’re looking for splice. Example: http://jsbin.com/oteme3:

    var a, b;
    
    a = [1, 2, 3, 15, 20, 12, 14, 18, 7, 8];
    display("a.length before = " + a.length);
    b = a.splice(3, 1);
    display("a.length after = " + a.length);
    display("b[0] = " + b[0]);
    

    …displays “a.length before = 10”, then “a.length after = 9”, then “b[0] = 15”

    Note that splice returns an array of the removed values rather than just one, but that’s easily handled. It’s also convenient for inserting values into an array.

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

Sidebar

Related Questions

how i can duplicate one element from array: for example, i have this array:
I have an array of numbers, each one of these number represents weight. the
I have this array, for example (the size is variable): x = [1.111, 1.122,
For example i have an array like this: $test= array(0 => 412, 1 =>
I have a PHP array which looks like this example: $array[0][0] = 'apples'; $array[0][1]
I have an array list of objects and I am using this example to
I have for example this string: iCanSeeBluePeople and I need it to separate it
I need to randomly generate an two-dimensional n by n array. In this example,
for each letter in the alphabet i have an int-array declared like this: int
I have an array char[] Select = {'A','B','C','D','E','F','G','H','I','J'} and each element in this array

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.