I am starting to think Javascript has too many blanks to be filled (which justify branching for both languages Coffeescript and Typescript). A particular case (there may be others, but I cannot list each comb-relaton without exhaustive experimentation) is:
Some functions like map
, every
, forEach
, among others, takes into account iterable artifacts e.g. strings and Array. There may be other kinds of varibles which these functions apply.
For now, I go (no pun intended with ) with function below:
const isIterable = (candidate) => candidate isinstanceof String || candidate isinstanceof Array;
There are other candidates for ECMA features, but this seems a hot one. 🙂