Write a function to return the Fibonacci Words upto N. N will be provided as a parameter to the function. The function should return an array of objects. The objects should be of the form : { N: 1, Length: 1, Entropy: 0, Word: '1' }. More details are given below :
The Fibonacci Word may be created in a manner analogous to the Fibonacci Sequence as described here:
Define F_Word1 as 1
Define F_Word2 as 0
Form F_Word3 as F_Word2 concatenated with F_Word1 i.e.: 01
Form F_Wordn as F_Wordn-1 concatenated with F_wordn-2
fibWord
is a function.
testString: assert(typeof fibWord === 'function', 'fibWord
is a function.');
- text: fibWord(5)
should return an array.
testString: assert(Array.isArray(fibWord(5)),'fibWord(5)
should return an array.');
- text: fibWord(5)
should return '+JSON.stringify(ans)+'
.
testString: assert.deepEqual(fibWord(5),ans,'fibWord(5)
should return '+JSON.stringify(ans)+'
.');
```