Assume the following JavaScript program was interpreted using static-scoping rules. What value of x is displayed in function sub1? Under dynamic-scoping rules, what value of x is displayed in function sub1?
สมมติว่า โปรแกรมจาวาสคริปต์ดังต่อไปนี้ถูกแปลโดยใช้กฎการกำหนดโครงร่างวิจัยคง แสดงว่าค่าของ x ในฟังก์ชัน sub1ภายใต้กฎกำหนดโครงร่างวิจัยไดนามิก แสดงว่าค่าของ x ในฟังก์ชันsub1