100% complated

pull/420/head
Fitsumhelina 10 months ago
parent 38653a50b6
commit 61a4ba8569

@ -50,43 +50,43 @@ const users = {
} }
} }
// Find the person who has many skills in the users object. // Find the person who has many skills in the users object.
// let maxskill =0 let maxskill =0
// let mostskilledperson=null let mostskilledperson=null
// for (const user in users){ for (const user in users){
// const skillcount = users[user].skills.length const skillcount = users[user].skills.length
// if (skillcount > maxskill){ if (skillcount > maxskill){
// maxskill = skillcount maxskill = skillcount
// mostskilledperson = user mostskilledperson = user
// } }
// } }
// console.log(`The person with the most skills is ${mostskilledperson} with ${maxskill} skills.`) console.log(`The person with the most skills is ${mostskilledperson} with ${maxskill} skills.`)
// Count logged in users,count users having greater than equal to 50 points from the following object. // Count logged in users,count users having greater than equal to 50 points from the following object.
// let looged = 0 let looged = 0
// let person = 0 let person = 0
// for (const user in users ){ for (const user in users ){
// if (users[user].points >= 50 ){ if (users[user].points >= 50 ){
// person++ person++
// } }
// if (users[user].isLoggedIn){ if (users[user].isLoggedIn){
// looged++ looged++
// } }
// } }
// console.log(`Number of logged in users are ${looged}. ${person} users are greater than 50`) console.log(`Number of logged in users are ${looged}. ${person} users are greater than 50`)
// Find people who are MERN stack developer from the users object // Find people who are MERN stack developer from the users object
// const mern = ["MongoDB", "Express", "React", "Node"]; const mern = ["MongoDB", "Express", "React", "Node"];
// let dev = 0; let dev = 0;
// for (const user in users) { for (const user in users) {
// if (mern.every(skill => users[user].skills.includes(skill))) { if (mern.every(skill => users[user].skills.includes(skill))) {
// dev++; dev++;
// } }
// } }
// console.log(`Number of MERN stack developers are ${dev}.`); console.log(`Number of MERN stack developers are ${dev}.`);
// Set your name in the users object without modifying the original users object // Set your name in the users object without modifying the original users object
const copyperson = Object.assign({}, users) const copyperson = Object.assign({}, users)
@ -98,18 +98,15 @@ copyperson.Fitsum = {
}; };
// console.log(copyperson.Fitsum); // console.log(copyperson.Fitsum);
const key = Object.keys(copyperson)
// const key = Object.keys(copyperson) console.log(`Key ${key}`)
// console.log(`Key ${key}`)
// Get all the values of users object // Get all the values of users object
const val = Object.values(copyperson)
// const val = Object.values(copyperson) console.log(`Value ${val}`)
// console.log(`Value ${val}`)
// Use the countries object to print a country name, capital, populations and languages. // Use the countries object to print a country name, capital, populations and languages.
const country = { const country = {
name: "Japan", name: "Japan",
capital: "Tokyo", capital: "Tokyo",

Loading…
Cancel
Save