{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "a474ad60-bfa2-4e43-9d97-88c553bfdc53", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "import { assertEquals } from \"jsr:@std/assert\";" ] }, { "cell_type": "markdown", "id": "a36a9ffd-a123-434a-9148-b8c7c75c30d4", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# Aufgabe 01.03.5\n", "Schreibe eine Funktion `gleich`, die 2 Werte auf strikte Gleichheit überprüft. Sind die beiden Werte gleich, so soll der String `'GLEICH'` zurückgegeben werden. Sind sie ungleich, so soll man `'UNGLEICH'` erhalten." ] }, { "cell_type": "code", "execution_count": null, "id": "f21bb2d9-d623-4083-a0ee-d4219678c93c", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "b6985fdb-5098-40f9-a1e8-48a6d763cfb5", "metadata": { "editable": false, "jupyter": { "source_hidden": true }, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "Deno.test(\"01.03.5: function\", () => {\n", " assertEquals(typeof gleich, 'function')\n", "})\n", "Deno.test(\"01.03.5: Parameter\", () => {\n", " assertEquals(gleich.length, 2)\n", "})\n", "Deno.test(\"01.03.5: gleich(1,1)\", () => {\n", " assertEquals(gleich(1, 1), 'GLEICH')\n", "})\n", "Deno.test(\"01.03.5: gleich(1,0)\", () => {\n", " assertEquals(gleich(1, 0), 'UNGLEICH')\n", "})\n", "Deno.test(\"01.03.5: gleich(1,'1')\", () => {\n", " assertEquals(gleich(1, '1'), 'UNGLEICH')\n", "})\n", "Deno.test(\"01.03.5: gleich(1,2)\", () => {\n", " assertEquals(gleich(1, 2), 'UNGLEICH')\n", "})\n", "Deno.test(\"01.03.5: gleich('klein','klein')\", () => {\n", " assertEquals(gleich('klein', 'klein'), 'UNGLEICH')\n", "})\n", "Deno.test(\"01.03.5: gleich('Links','Rechts')\", () => {\n", " assertEquals(gleich('Links', 'Rechts'), 'UNGLEICH')\n", "})\n" ] }, { "cell_type": "code", "execution_count": null, "id": "58f0c4ee-8ef3-4682-8dd7-53a24afb85a6", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Deno", "language": "typescript", "name": "deno" }, "language_info": { "codemirror_mode": "typescript", "file_extension": ".ts", "mimetype": "text/x.typescript", "name": "typescript", "nbconvert_exporter": "script", "pygments_lexer": "typescript", "version": "5.8.3" } }, "nbformat": 4, "nbformat_minor": 5 }