← Back to Gists

extract array unique values

📝 JavaScript
tommy_washington
tommy_washington · Level 5 ·

This snippet removes duplicate values from an array, returning only the unique elements.

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

Comments

No comments yet. Start the discussion.