Answer the question
In order to leave comments, you need to log in
Is it possible to take the value of a neighboring key inside an object?
this is exactly what I want, how to do it right?
let left = "hi ",
right = "!!!!?";
let mass = [
{
name: "Kianu", //взять значение отсюда
age: 232,
message: [left + this.name + right] //вставить это значение между left и right,
},
{
name: "Saruman",
age: 19332,
message: [left + mass[1].name + right]
},
];
console.log(mass[0].message)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question