1

I have an array of values

var test =[];
test [1] = [
    {"myself":true,chat_user:11,"message":"Hi"},
    {"myself":true,chat_user:11,"message":"Evida"},
    {"myself":false,chat_user:11,"message":"yes"},
]

test [6] = [
    {"myself":true,chat_user:13,"message":"Hi"},
    {"myself":true,chat_user:13,"message":"Evida"},
    {"myself":false,chat_user:13,"message":"yes"},
]

test [9] = [
    {"myself":true,chat_user:22,"message":"Hi"},
    {"myself":true,chat_user:22,"message":"Evida"},
    {"myself":false,chat_user:22,"message":"yes"},
]

Now i have to remove the entry test[6] and need to get the remaining array

ie

 test [1] = [
        {"myself":true,chat_user:11,"message":"Hi"},
        {"myself":true,chat_user:11,"message":"Evida"},
        {"myself":false,chat_user:11,"message":"yes"},
    ]

    test [9] = [
        {"myself":true,chat_user:22,"message":"Hi"},
        {"myself":true,chat_user:22,"message":"Evida"},
        {"myself":false,chat_user:22,"message":"yes"},
    ]

Is there any function in node js, for getting this ?

Thanks in advance

1 Answer 1

1

I'd suggest to use:

delete test[6]

Sign up to request clarification or add additional context in comments.

2 Comments

is there any way to find an element is present or not in the given array ?
@LintoPD What do you exactly mean, can you please explain?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.