In the Google Chrome console, if I type fn
where fn
is a function, then I get the code for fn
. In the Node console, typing require.resolve
simply prints out
[Function]
Why don't I get the function definition?
Execute the function. A function can be executed by calling the execute() method in which the function ID and configuration (of type JSON) are passed as parameters. The functions reference used in the code snippets below is the component instance.
Make sure the node path is added, if not added it. After doing this restart Visual Studio or open a fresh command prompt. From the command prompt type 'node -v' to echo the node version installed. You can also add the path to node or any other application directly on the command line.
node also prints undefined because IN GENERAL, it displays the return value of each command and console. log doesn't return anything. Show activity on this post. this is happening because console.
log() function from console class of Node. js is used to display the messages on the console. It prints to stdout with newline. Parameter: This function contains multiple parameters which are to be printed.
From the comments: use fn.toString()
.
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