JS function for writing out a word, binary counter style
How can I create a loop to output any given word like this:

...if the word is 'abcd'

a---
 
-b--

ab--

--c-

a-c-

-bc-

abc-

---d

a--d

-b-d

ab-d

--cd

a-cd

-bcd

abcd

in other words, letters appear in binary counter order

1000

0100

1100

0010

1010

etc.

Thanks
JS function for writing out a word, binary counter style
===

How can I create a loop to output any given word like this:

...if the word is 'abcd'

a---
 
-b--

ab--

--c-

a-c-

-bc-

abc-

---d

a--d

-b-d

ab-d

--cd

a-cd

-bcd

abcd

in other words, letters appear in binary counter order

1000

0100

1100

0010

1010

etc.

Thanks