Skip to content

rstropek/ignite-2022-gh-classroom-intro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published