Created
February 28, 2019 06:15
-
-
Save devarajchidambaram/9a5651a68cb885fb530d5f594855b8bb to your computer and use it in GitHub Desktop.
captureStackTrace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error.captureStackTrace(targetObject[, constructorOpt])# | |
targetObject <Object> | |
constructorOpt <Function> | |
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. | |
const myObject = {}; | |
Error.captureStackTrace(myObject); | |
myObject.stack; // similar to `new Error().stack` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment