How to remove specific object from array

Engaged ,
May 11, 2022 May 11, 2022

Copy link to clipboard

Copied

Hello friends!
How to remove specific object from array

items = ['a', 'b', 'c', 'd'];
items.remove([0]); // "a" remove

 

TOPICS
Actions and scripting , SDK

Views

78

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 11, 2022 May 11, 2022
(items = ['a', 'b', 'c', 'd']).splice(0, 1)

Likes

Translate

Translate
LEGEND ,
May 11, 2022 May 11, 2022

Copy link to clipboard

Copied

(items = ['a', 'b', 'c', 'd']).splice(0, 1)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

If it is just about the first item, shift would also work

items = ['a', 'b', 'c', 'd'];
items.shift();

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

I would suggest exaclty same, but 'specific' item implies it has to work for wider scope of elements 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

LATEST

Thanks @c.pfaffenbichler , the first item was just an example.

@Kukurykus  worked really good! Thank you for your support

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines