In Chrome's JavaScript console, how do I call a function that belongs to a .js file included in the webpage I am viewing?
To enter JavaScript statements and expressions interactively in the Console: Right-click in a webpage and then select Inspect. DevTools opens. Or, press Ctrl + Shift + J (Windows, Linux) or Command + Option + J (macOS), to directly open the DevTools console.
However, what is not understandable is using JavaScript which runs only the browser, to get input from a systems command line. Doing this is possible using NodeJS. It will require us to use the readline() package. With this package, we can then accept user input and even output it to the console.
If it's inside a closure, i'm pretty sure you can't.
Otherwise you just do functionName();
and hit return.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With