Ralph David Abernathy
Ralph David Abernathy

Reputation: 5518

How to remove indexes from array, only leaving values?

I have this array that's logged like so:

enter image description here

How can I "convert" the array to be simpler, so it outputs like this? ["Acura", "Aston Martin", ...]

Thanks!

Upvotes: 2

Views: 52

Answers (1)

GirkovArpa
GirkovArpa

Reputation: 4942

Instead of this:

console.log(["Acura", "Aston Martin"]);

Do this:

console.log(JSON.stringify(["Acura", "Aston Martin"]));

Upvotes: 1

Related Questions