← Back to Gists

Get unique values array

📝 JavaScript
yvonne
yvonne · Level 1 ·

This snippet removes duplicates from an array, returning a new array containing only unique values.

JavaScript
function getUniqueValues(arr) { return [...new Set(arr)];
}

Comments

No comments yet. Start the discussion.