diff --git a/tests/exercises/echo-function/solution/top-level-output.ts b/tests/exercises/echo-function/solution/top-level-output.ts new file mode 100644 index 00000000..4325cd2c --- /dev/null +++ b/tests/exercises/echo-function/solution/top-level-output.ts @@ -0,0 +1,13 @@ +function echo(content: Object) { + return content; +} + +function noEcho(content: Object) { + // Do nothing. +} + +function toString(number: Object): string { + return number.toString(); +} + +console.log("This is top-level output"); diff --git a/tests/exercises/echo-function/solution/unknown-return-type.ts b/tests/exercises/echo-function/solution/unknown-return-type.ts new file mode 100644 index 00000000..85b5d277 --- /dev/null +++ b/tests/exercises/echo-function/solution/unknown-return-type.ts @@ -0,0 +1,15 @@ +class Coord { + + public x: number; + public y: number; + + constructor(x: number, y: number ) { + this.x = x; + this.y = y; + } + +} + +function echo(content: unknown) { + return new Coord(5, 7); +}