TGViewer
JavaScript test JavaScript test @js_test · 9.68K subscribers
Post #5041 703
❗️Что будет на выходе:

const user = {
profile: {
name: 'Alice',
social: null,
getDetails() {
return { verified: true };
}
}
};

const result = [
user?.profile?.name,
user?.profile?.social?.handle,
user.profile.getDetails?.()?.verified,
user?.nonExistent?.property
];

console.log(result);


Ответ: ['Alice', undefined, true, undefined]

JavaScript test | #JavaScript
More from @js_test
  1. Oct 14, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
  2. Oct 14, 2026Как платить за границей и за зарубежные сервисы в 2026 году? Можно переплачивать посредник…
  3. Oct 14, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  4. Oct 14, 2026❗️Что будет на выходе: const regex = /a/g; const str = 'banana'; console.log(str.match(reg…
  5. Oct 13, 2026❓Что будет на выходе? const sym1 = Symbol('description'); const sym2 = Symbol('description…
  6. Oct 13, 2026❗️Что будет на выходе: function Animal(name) { this.name = name; } Animal.prototype.speak…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →