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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:55:37+00:00 2026-06-01T23:55:37+00:00

I have following object: {"2":{"cid":"2","uid":"2"},"1":{"cid":"1","uid":"3"}} In this example I want to remove "1":{"cid":"1","uid":"3"} from

  • 0

I have following object:

{"2":{"cid":"2","uid":"2"},"1":{"cid":"1","uid":"3"}}

In this example I want to remove

"1":{"cid":"1","uid":"3"}

from it.
I have tried all solutions that I found on Stack Overflow, and could not make any of them work. I am mostly PHP person, so I might miss something important here?

  • 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-01T23:55:40+00:00Added an answer on June 1, 2026 at 11:55 pm

    Just use delete with the appropriate property.

    var obj = {"2":{"cid":"2","uid":"2"},"1":{"cid":"1","uid":"3"}};
    
    delete obj["1"];
    

    Note the " around the 1 to mark it as an identifier and not as an array index!

    EDIT
    As pointed out in the comment, obj is an object and no array no matter how you address the [1] property. My last note was just to make it clear that you are working with an object and not an array.

    In my experience most people associate integer properties with arrays and string properties with objects. So I thought it might be more helpful to highlight the property in the way given.

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

Sidebar

Related Questions

I have following object structure, deseralized from XML (WS): <ns2:Category> <ns2:CategoryId>800003</ns2:CategoryId> <ns2:CategoryName>Name1</ns2:CategoryName> <ns2:Categories> <ns2:Category>
I have the following object: var r = { obj: $(this), children: $(this).children(), panes:
Hi I have the following object: Hashtable<Object, Double> and I want to find the
I have taken the following object as an example: var questions = { 1:
I have a UITableViewController that when opened displays a table of the following object:
Let's say I have a following object: { "id": "109", "No. of interfaces": "4"
I have the following in my web.config <httpErrors errorMode="Custom"> <remove statusCode="500" subStatusCode="-1" /> <error
I have the following block of code that works just fine: <%@page import="java.util.*" %>
I know that this might be a duplicate of: Return a "NULL" object if
I have the following File object pointing to a directory via symbolic link, File

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.