Skip to content

Instantly share code, notes, and snippets.

@appoll
Created November 25, 2020 18:02
Show Gist options
  • Save appoll/2b3615fab2f2ebb55304690ae82acb8f to your computer and use it in GitHub Desktop.
Save appoll/2b3615fab2f2ebb55304690ae82acb8f to your computer and use it in GitHub Desktop.
// E0.
// 0.1 Add another property to each book object. e.g. language
// 0.2 Write a function that prints the book language.
// 0.3 Write a function that prints the book details in the language in which the book is written:
// if the language of the book is "english", print the message in english:
// "The price of the book is ... and the title is ..."
// if the language of the book is "german", print the message in german
let book1 = {
title: "Gone with the wind",
price: 30
}
let book2 = {
title: "Gone with the wind",
price: 40
}
function printBookLanguage(book){
// your code here
}
function printBookDetailsInBookLanguage(book){
// your code here
// console.log(`This book is called ${book.title} and it costs ${book.price}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment