Skip to content
Advertisement

Get all possible combinations without duplicates

How can I get all the possible combinations of given numbers. For instance I have

$arr = [ 1, 2, 3, 4]

I want to get the combinations without any duplicates inside the combinations

JavaScript

Advertisement

Answer

I hope below function work as per your expected output :

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement