اثنا عشر سؤالًا تغطي الدورة كلها. احصل على 70% أو أكثر لتنجح وتفتح شهادتك. يمكنك إعادته متى شئت.
أنهِ كل الدروس لتحصل على الشهادة، ويمكنك خوض الاختبار في أي وقت.
السؤال 1 من 12
ماذا يطبع console.log(typeof (450 + "50"), 450 - "50")؟
console.log(typeof (450 + "50"), 450 - "50")
number 400
string 45050
string 400
number 500
السؤال 2 من 12
ماذا تُرجع [3, 1, 2].map((n) => n * 2).filter((n) => n > 2)؟
[3, 1, 2].map((n) => n * 2).filter((n) => n > 2)
[6, 4]
[4, 6]
[6, 2, 4]
[3, 2]
السؤال 3 من 12
مصروف ليست له خاصية receipt. أيّ تعبير يرمي خطأ؟
receipt
expense.receipt?.url
expense?.receipt
expense.receipt ?? "none"
expense.receipt.url
السؤال 4 من 12
بأي ترتيب تُطبع الحروف؟
setTimeout(() => console.log("A"), 0); (async () => { console.log("B"); await null; console.log("C"); })(); console.log("D");
السؤال 5 من 12
totalsByCategory تستخدم reduce مع {} قيمةً ابتدائية، وترمي Cannot read properties of undefined عند المصروف الثاني. ما السبب الأرجح؟
totalsByCategory
reduce
{}
Cannot read properties of undefined
[]
return totals
undefined
السؤال 6 من 12
جزءان من Pocket يستدعي كلٌّ منهما createIdGenerator("exp")، وأحيانًا يُنتجان المعرّف نفسه. ما الإصلاح الصحيح؟
createIdGenerator("exp")
var
Math.round(Math.random() * 10)
السؤال 7 من 12
تُعرض قائمة تسميات بـ li.innerHTML = `<b>${label}</b>`; ويحفظ مستخدم التسمية <img src=x onerror=alert(1)>. ما الإصلاح الآمن؟
li.innerHTML = `<b>${label}</b>`;
<img src=x onerror=alert(1)>
<b>
createElement
textContent
outerHTML
innerHTML
السؤال 8 من 12
getJson تُرجع promise يُرفض. ماذا تفعل safeLoad()؟
getJson
safeLoad()
async function safeLoad() { try { return getJson("/api/rates"); } catch { return {}; } }
await
try
السؤال 9 من 12
تحتاج إلى amounts مرتّبة من الأكبر إلى الأصغر لرسم بياني، بينما ما زالت لوحة أخرى تعرض amounts بترتيبها الأصلي. أيّ سطر صحيح؟
amounts
amounts.sort((a, b) => b - a)
amounts.toSorted()
[...amounts].sort()
amounts.toSorted((a, b) => b - a)
السؤال 10 من 12
items.forEach(store.add); ترمي Cannot read properties of undefined (reading '#items') داخل add. أيّ تغيير يُصلح ذلك؟
items.forEach(store.add);
Cannot read properties of undefined (reading '#items')
add
store
let
const
items.forEach(store.add());
items.forEach((item) => store.add(item));
const add = store.add;
السؤال 11 من 12
الفحص if (amountInput.value == 0) مقصود منه التقاط مبلغ قيمته صفر. لماذا يُنفَّذ أيضًا حين يكون الحقل فارغًا؟
if (amountInput.value == 0)
==
""
"" == 0
value
null
NaN
NaN == 0
السؤال 12 من 12
ماذا يحدث مع JSON.parse(JSON.stringify({ when: new Date() })).when.getFullYear()؟
JSON.parse(JSON.stringify({ when: new Date() })).when.getFullYear()
when
getFullYear
12 سؤالًا بلا إجابة