Т
Size: a a a
В
(function() {
const getCombinations = (str) => {
const count = 2 ** (str.length - 1);
const result = [];
for (let x = 0; x < count; x++) {
result.push(str.split('').map((char, i) => (char + ((x >> i) & 1 === 1 ? '.' : ''))).join(''))
}
return result;
}
console.log(getCombinations('abcde'));
}())
p
С
p
S
let module = (...params) => ({
method1: () => { /* code */ },
method2: () => { /* code */ }
});