Dada una lista de muchas cadenas arbitrarias, implemente una función para cada una de las siguientes condiciones:
prueba si todos son léxicamente iguales prueba si cada cadena es léxicamente menor que la siguiente (es decir, si la lista está en estricto orden ascendente)allEqual
es una función.
testString: 'assert(typeof allEqual === "function", "allEqual
is a function.");'
- text: azSorted
es una función.
testString: 'assert(typeof azSorted === "function", "azSorted
is a function.");'
- text: 'allEqual(["AA", "AA", "AA", "AA"])
devuelve true.'
testString: 'assert(allEqual(testCases[0]), "allEqual(["AA", "AA", "AA", "AA"])
returns true.");'
- text: 'azSorted(["AA", "AA", "AA", "AA"])
devuelve falso.'
testString: 'assert(!azSorted(testCases[0]), "azSorted(["AA", "AA", "AA", "AA"])
returns false.");'
- text: 'allEqual(["AA", "ACB", "BB", "CC"])
devuelve falso.'
testString: 'assert(!allEqual(testCases[1]), "allEqual(["AA", "ACB", "BB", "CC"])
returns false.");'
- text: 'azSorted(["AA", "ACB", "BB", "CC"])
devuelve verdadero.'
testString: 'assert(azSorted(testCases[1]), "azSorted(["AA", "ACB", "BB", "CC"])
returns true.");'
- text: 'allEqual([])
devuelve true.'
testString: 'assert(allEqual(testCases[2]), "allEqual([])
returns true.");'
- text: 'azSorted([])
devuelve true.'
testString: 'assert(azSorted(testCases[2]), "azSorted([])
returns true.");'
- text: 'allEqual(["AA"])
devuelve true.'
testString: 'assert(allEqual(testCases[3]), "allEqual(["AA"])
returns true.");'
- text: 'azSorted(["AA"])
devuelve true.'
testString: 'assert(azSorted(testCases[3]), "azSorted(["AA"])
returns true.");'
- text: 'allEqual(["BB", "AA"])
devuelve false.'
testString: 'assert(!allEqual(testCases[4]), "allEqual(["BB", "AA"])
returns false.");'
- text: 'azSorted(["BB", "AA"])
devuelve falso.'
testString: 'assert(!azSorted(testCases[4]), "azSorted(["BB", "AA"])
returns false.");'
```