I have a basic .js file saved on one of my drives that contains the following code:
var x=3;
function numSqaure(x)
{
return(x*x);
}
var sentence="The square of" + x + "is" + numSqaure(x);
console.log(sentence);
When attempting to run this script through Powershell, I encountered an error stating 'console' is undefined.
Can someone please advise on how to resolve this error specifically within Powershell?