Übung 14: Equality Narrowing in einer Funktion implementieren
Gegeben ist eine unvollständige Funktion analyzeInput
Vervollständige die Funktion analyzeInput so, dass sie zurückgegeben wird:
- "Input is exactly true" wenn input === true.
- "Input is exactly false" wenn input === false.
- "Input is zero" wenn input === 0.
- "Input is a positive number" wenn input eine Zahl größer als null ist.
- "Input is a negative number" wenn input eine Zahl kleiner als null ist.
- "Input is the string 'hello'" wenn input === "hello".
- "Input is another string" wenn input irgendein anderer String ist.
- "Unknown input" andernfalls.
Verwende Equality- und Vergleichsoperatoren, um den Typ und den Wert der Eingabe einzugrenzen.