Skip to content

Instantly share code, notes, and snippets.

View ggondim's full-sized avatar
Building a more reusable JavaScript ecosystem

Gustavo Gondim ggondim

Building a more reusable JavaScript ecosystem
View GitHub Profile
@ggondim
ggondim / index.html
Last active September 17, 2015 06:27 — forked from anonymous/index.html
An Angular.js playground to play with promises. // source http://jsbin.com/yecedi
<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() {
function permutation(collection) {
let current;
let result = [];
const currentArray = [];
const newResultArray = [];
if (collection.length) {
current = collection.shift();
result = permutation(collection);