SyntaxFix
Write A Post
Hire A Developer
Questions
A cleaner way to do this:
class Book { public Title: string; public Price: number; public Description: string; constructor(public BookId: number, public Author: string){} }
Then
var bks: Book[] = [ new Book(1, "vamsee") ];