Skip to content

software-architects/typescript-course-fsch

Repository files navigation

Open in Visual Studio Code

Assignment: TypeScript

Introduction

Goal of this homework is to practice writing math-related TypeScript code.

Note that this is just a sample for introduction to GitHub Classroom.

Solutions

Level 1

export function add(x: number, y: number): number {
  return x + y;
}

Level 2

export function fizzBuzz(value: number): string {
  if (value % 3 === 0) {
    if (value % 5 === 0) {
      return "FizzBuzz";
    }

    return "Fizz";
  }

  if (value % 5 === 0) {
    return "Buzz";
  }

  return value.toString();
}

Level 3

export function getLengthOfVector(vec: [number, number]): number {
  return Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
}

About

typescript-course-fsch created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published