refactor snippet reducing the amount of lines

This commit is contained in:
King
2018-02-12 16:47:53 -05:00
parent d75bdd9805
commit c435f64868
2 changed files with 4 additions and 10 deletions

View File

@ -7,11 +7,8 @@ const permuteAll = (input) => {
const result = [];
let inputState = input;
if (typeof input === 'string') {
inputState = input.split('');
} else if (typeof input === 'number') {
inputState = (input).toString().split('');
}
if (typeof input === 'string') inputState = input.split('')
if (typeof input === 'number') inputState = (input).toString().split('');
const permute = (arr, m = []) => {
if (arr.length === 0) {