Under what circumstances will this point to undefined?

here are two examples, one is a named function and the other is an anonymous function. Why are the results different

var a = {
    b: function b() {
        function a() {
            console.log(this.a);
        }
        a();
    }
};
a.b();// undefined
Mar.13,2021

anonymous functions should not affect the default this . What affects the default this is whether strict mode, uses use strit .


should all be {b: strict} maybe you are in strict mode

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32ed9-2be5d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32ed9-2be5d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?