From 38653a50b680aeceaa0aa0e0a7af59f40244dbd0 Mon Sep 17 00:00:00 2001 From: Fitsumhelina Date: Fri, 22 Nov 2024 00:35:31 +0300 Subject: [PATCH] 100% complated --- Exercises/day-1/object-exercise-2.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Exercises/day-1/object-exercise-2.js b/Exercises/day-1/object-exercise-2.js index 32c69bb..e0f51b8 100644 --- a/Exercises/day-1/object-exercise-2.js +++ b/Exercises/day-1/object-exercise-2.js @@ -99,13 +99,28 @@ copyperson.Fitsum = { // console.log(copyperson.Fitsum); -const key = Object.keys(copyperson) -console.log(`Key ${key}`) +// const key = Object.keys(copyperson) +// console.log(`Key ${key}`) // Get all the values of users object -const val = Object.values(copyperson) -console.log(`Value ${val}`) +// const val = Object.values(copyperson) +// console.log(`Value ${val}`) -// Use the countries object to print a country name, capital, populations and languages. \ No newline at end of file +// Use the countries object to print a country name, capital, populations and languages. + +const country = { + name: "Japan", + capital: "Tokyo", + population: 126476461, + languages: ["Japanese"], +} +const getinfo = function (copyperson ) { + console.log(`Country Name: ${copyperson.name}`) + console.log(`Capital: ${copyperson.capital}`) + console.log(`Population: ${copyperson.population}`) + console.log(`Languages: ${copyperson.languages.join(", ")}`) +} + +getinfo(country) \ No newline at end of file