I have recently started learning JavaScript and I have a query regarding the usage of variables in the Console.log function.
What could possibly cause an error in this code snippet?
var myAns = console.log(65/240);
console.log(100* +Number(myAns) );
If I am storing the output of Console.log in the variable 'myAns', should I not be able to use it as a reference in another Console.log statement?
I tried using an additional + operator before the value (didn't work), or using the Number() method instead (also didn't work).
The error message that's being displayed is simply: NaN
Could this be because of pass by reference, or is it a scope-related issue?