This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var $q = angular.injector(['ng']).get('$q'); | |
var $timeout = angular.injector(['ng']).get('$timeout'); | |
function teste() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function permutation(collection) { | |
let current; | |
let result = []; | |
const currentArray = []; | |
const newResultArray = []; | |
if (collection.length) { | |
current = collection.shift(); | |
result = permutation(collection); |