A class has an and b function,a calling b. Visit a now, how to get the name? of an in b

as described in the question, how to implement

in each language

has been reported to the Shoushou Party! It is said that the hand-holding party or the problem is too stupid, but it does not explain the specific reason?

Mar.13,2021

PHP can be obtained using debug_backtrace .


javascript:

class Foo {
    a() {
        console.log('call func b');
        this.b();
    }
    b() {
        console.log(this.a.name);
    }
}

1:
class Foo {

function a(){
    var name = '';
    b(name);
}
function b(var name){
    console.log(name);
}

}

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-1b3049d-2bcf3.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-1b3049d-2bcf3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?