Created
December 27, 2018 00:11
-
-
Save METACEO/52b54f7b7d86e6185c2b8444f1c2bb15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let student = { | |
name: 'Alice', | |
major: 'Computer Science', | |
year: 2 | |
}; | |
// into... | |
class Student { | |
constructor(public name: string, | |
public major: string, | |
public year: number) { | |
} | |
} | |
let student = { | |
name: 'Alice', | |
major: 'Computer Science', | |
year: 2 | |
}; | |
// ...finally: | |
let student = new Student('Alice', 'Computer Science', 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment