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!