class Book {
    constructor(title, author) {
    this.title  = title;
    this.author = author;
  }
}

const title  = prompt("Book title:");
const author = prompt("Author:");
console.log(new Book(title, author));