code: function toPairs (v) {
    if (ktypes.isArray(v)) {
      var pairs = []
      var i
      for (i = 0; i < v.length; i++) {
        pairs.push([i, v[i]])
      }
      return pairs
    }
    return _.toPairs(v)
  }
docs: used by `foreach` in krl
  Array's use index numbers, maps use key strings