Why VS doesn't give me the same result as console in DevTools?

I’m sorry if this questions is being raised but I’m really new to coding and started to have the first difficult issue and can’t figure it out. I have write a simple code like this because I have to learn the return command:

function multiplyByNineFifths (number) {
    return number *(9/5);
};

function getFahrenheit (celcius) {
    return multiplyByNineFifths (celcius) + 32;
};

getFahrenheit(15);

but when when I want to run the code in VS it says:

[Running] node "c:\Users\Oerd Bej\Desktop\JavaScript
exercises\tempCodeRunnerFile.js"
[Done] exited with code=0 in 0.088 seconds`

while in DevTools in console it runs perfectly and it gives me the right answer which is 59.

Please can you help me to figure it out what should I do, I have installed node.js and all the necessary plug in in VS but dont know what is wrong or what is the right question that I have to ask in order to understand it well. Every error in VS it breaks my heart

enter image description here

25 thoughts on “Why VS doesn't give me the same result as console in DevTools?”

  1. It’s because logging is a little different in Chrome than in Node. If you type console.log(3) in Chrome, it will log 3, and then the return value of console.log which is undefined (because console.log doesn’t return anything). Chrome will always automatically log the function’s return value. Node doesn’t. It will only log 3. Node executes the getFahrenheit function, but this function doesn’t return anything. It just computes a number in memory, that’s it, so nothing gets displayed. If you want to see the result of this operation you need to log it with console.log(getFahrenheit(15)).

    Reply
  2. community bible church jackson wy community togetherness synonym , environments definition. strategic planning process video Pregabalin lyrica without prescription , positive quotes keep going community action council pierce county culture kings promo code , community health center definition positive feedback response example? individual level processes definition community blood bank blue springs missouri, community first credit union sign in positive feedback to regain homeostasis.
    positive words beginning with a , community first credit union in neenah community cast paget brewster community first credit union beach blvd.

    Reply
  3. photoshop 2020 software download drawing program website to buy Autocad software revit 2020 software free download. alternative office software for mac free 2020 tax preparation software engeeeneringu#$sssaunnplus , free office software xp. rt809f programmer software 2020, office software protection platform service 1003 office software uk office furniture software programs. 2020 interior design software pvt ltd urdu ms office software free download, design software 2020.

    Reply

Leave a Comment