Защо не минава в judge?
Здравейте,
защо не минава следният код в judge: https://pastebin.com/YDcu8zMN ? Това е първа задача от тук: https://judge.softuni.bg/Contests/Practice/Index/1323#0 . На Visual Studio Code работи както трябва.
Здравейте,
защо не минава следният код в judge: https://pastebin.com/YDcu8zMN ? Това е първа задача от тук: https://judge.softuni.bg/Contests/Practice/Index/1323#0 . На Visual Studio Code работи както трябва.
function solve(firstName, lastName, age)
{
let person =
{
firstName: firstName,
lastName: lastName,
age: age
};
return person;
}
Write a function that receives 3 parameters, sets them to an object and returns that object.
Благодаря! Така мина. Но на мен ми пише Write a function that receives 3 parameters, sets them to an object and prints the object's properties by key and value in the format: "{key}: {value}" . Не мога да се справя и със втората задача. Може ли да я погледнеш? https://pastebin.com/ru3A9SzR .
function solve(city) { // let city = // { // name: name, // area: area, // population: population, // country: country, // postCode: postCode // }; // let output = ''; for (let key in city) { // output += `${key} -> ${city[key]}\n`; console.log(`${key} -> ${city[key]}`); } // return output; } solve({ name: "Sofia", area: 492, population: 1238438, country: "Bulgaria", postCode: "1000" });
Благодаря. Как разбра, че се подава обект като вход, след като в задачата пише да го създадем?