TGViewer
JavaScript test JavaScript test @js_test · 9.74K subscribers
Post #6560 113
❗️Что будет на выходе?

const user = {
profile: {
name: 'Alice',
settings: {
notifications: {
email: true,
sms: false
}
}
},
getPreference(type) {
return this.profile?.settings?.notifications?.[type] ?? 'not configured';
}
};

const admin = {
profile: {
name: 'Admin',
settings: null
},
getPreference: user.getPreference
};

console.log(admin.getPreference('email'));

Ответ: not configured

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 27, 2026❗️Что будет на выходе: function processConfig(config) { const cache = config.cache ?? true…
  2. Sep 27, 2026Хочешь заговорить на английском, но не с кем практиковаться? Появилась ИИ-девушка, с котор…
  3. Sep 26, 2026❓Что будет на выходе? function recursivePascalTriangle(n, row = [1], triangle = []) { tria…
  4. Sep 26, 2026❗️Что будет на выходе: const regex = /a/g; const str = 'banana'; console.log(str.match(reg…
  5. Sep 26, 2026❗️Что будет на выходе: class MyClass { constructor() { this.a = 100; } } MyClass.prototype…
  6. Sep 25, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
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 →