This page is not available in English. Check automated translation.
  • Validate that function `toArray` is defined
    expect(typeof toArray).toBe('function')
  • var arrayLike = {}
    expect(toArray(arrayLike)).toEqual([])
  • var arrayLike = {0: "uno", length: 1}
    expect(toArray(arrayLike)).toEqual(["uno"])
  • Original object should not change
    var arrayLike = {0: "uno", length: 1}
    var arrayLikeMirror = {0: "uno", length: 1}
    toArray(arrayLike)
    expect(arrayLike).toEqual(arrayLikeMirror)