I wanna pass in some variables to my functions like int, string, and etc. I'm a C# developer and is very new in JS.
In C# we normally call a function with:
function computeGrade(int grade)
{
...
}
computeGrade(90);
I understand that js uses var that can either be a string, int, etc.
However when I try:
function ComputeGrade(var grade)
{
...
}
it gives me an error that it failed to initialize the function.
Forgive me for being too naive with js.
Thanks a ton!
varandlet, butletbehaves more like C# variables do with regards to scoping. Personally, I'd argue thatletis a better way to go these days.lettoo but was quite unsure on whether what's the main difference between the two. Thanks for the heads up! :) I'll try utilizinglet