Skip to content

Instantly share code, notes, and snippets.

@ianldgs
Last active August 29, 2015 14:22
Show Gist options
  • Save ianldgs/418b1e78f2643bd6b7df to your computer and use it in GitHub Desktop.
Save ianldgs/418b1e78f2643bd6b7df to your computer and use it in GitHub Desktop.
Get current line
function getLine() {
var s = new Error().stack,
r = /at\s.*:([\d]*):/g
r.exec(s)
return r.exec(s)[1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment