Given this array:
const FIB_SEQ = [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89];
shouldn't this work?
const found = FIB_SEQ.find((element) => element > 45);
The error I'm getting is "App: Unhandled exception: TypeError: Expected a function."
I tested this in a code playground and it works as expected there. Is there some limitation in the FitBit implementation of JS? I feel like I'm missing something very simple here... having the same problem with array.indexOf as well.
Best AnswerI don't know of any reference on that, although it would be good to have.
There is some support for async/await and fetch.
Best Answer
@Gondwana wrote:I don't know of any reference on that, although it would be good to have.
There is some support for async/await and fetch.
Yes, mostly I just try it. They've actually implemented more than they've documented, though there are some idiosyncrasies.
On a positive note, if the results seem weird there's usually some information in the SDK forum about it.
Just to point some official documentation:
https://dev.fitbit.com/build/guides/application/#javascript
There it says it's ES5, with the JerryScript engine https://github.com/jerryscript-project/jerryscript
As you noticed there are also some additions like Promises