This code checks the value a function's caller property.
Just console log your error stack.
Read AlsoCall and apply
You can use this code:
is equivalent to this:
In case we decide to refactor the name of the invoked function (Hello), we would have to change all its occurrences.
We can get the full stacktrace:
Until caller is null.
It cause an infinite loop on recursive function.
We can use Function.Caller to get the calling function. The following code illustrates its use: