Latihan 1 dari materi Framework DevTools: Vue & Angular di Debugging — praktek dengan editor kode interaktif, test case otomatis, dan hint terpandu. Langsung jalan di browser.
Simulasikan skenario debugging dengan framework DevTools — analisis component tree, state, dan change detection.
1. findComponentByState(tree, predicate)
tree: component tree { name, state, children? }predicate(state): return true kalau state match2. analyzeChangeDetection(cycles)
cycles: array { componentName, checked, duration, inputChanged }{ unnecessaryChecks, avgDuration, recommendation }:
unnecessaryChecks = count cycle di mana checked === true tapi inputChanged === falseavgDuration = rata-rata durasi SEMUA cycle (bulatkan integer)recommendation: "OnPush" kalau unnecessaryChecks > 50% total, else "OK"3. pickDevTools(framework)
"react", "vue", atau "angular"