I want to return the line number in my code, for example I want when I write console.log('SomeCode'); in the line 33 to return 33.
How can I do that in JavaScript?
I googled about it and I found this code :
try{ throw new Error('Buck stops here') }catch(e){ console.log( e.line) } But I don't want to use any try catch in my code.