In Swift, we can use Special literals to get fileName, methodName, lineNumber etc dynamically.
Is there similar functionality available in javascript to get fileName / methodName / lineNumber etc dynamically ?
In Swift, we can use Special literals to get fileName, methodName, lineNumber etc dynamically.
Is there similar functionality available in javascript to get fileName / methodName / lineNumber etc dynamically ?
Short answer:
no
You can get the name of a function in es6 with function.name
: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name but that's about it.
You could return these values from native code to js, but that would tell you about the swift file, not the js file.