Ligeramente superior

Los dos arreglos tienen la misma longitud y son idénticos o difieren en una posición. Devuelve true solo cuando el valor del primer arreglo es mayor en esa posición diferente. Devuelve false cuando los arreglos son idénticos.

Ejemplos

isFirstSuperior([1, 2, 4], [1, 2, 3]) ➞ true
// The pair of items at each index are compared in turn.
// 1 from the first array is the same as 1 from the second array.
// 2 is the same as 2.
// However, 4 is greater than 3, so first array is superior.

isFirstSuperior(["a", "d", "c"], ["a", "b", "c"]) ➞ true

isFirstSuperior(["zebra", "ostrich", "whale"], ["ant", "ostrich", "whale"]) ➞ true

isFirstSuperior([1, 2, 3, 4], [1, 2, 4, 4]) ➞ false

isFirstSuperior([true, 10, "zebra"], [true, 10, "zebra"]) ➞ false

Notas

  • Ambos arreglos tendrán la misma longitud.
  • Todos los valores y sus correspondientes siempre serán del mismo tipo de dato.
  • Si los dos arreglos son iguales, devuelve false.