function that will return the name of the data type of a variable?

Is there some function I can use that will return the name of the data type of a variable? I need to know this so I can call a function out of two functions I made that use different datatypes. I hope that does not sound too confusing. Thanks for the help.

This is called overloading and is a feature of many programming languages.

For example in c# you can do this

void FooMethod (string myString)
{
   // ....
}

void FooMethod (int myInt)
{
   //....
}

When you call either of these two methods the compiler will deduce wich method you wanted to call based on the type of the parameter you pass.

You dont need to do any checks yourself.

What alexfeature said is correct and thats deffo the way you should go about it, but if you really want to get the datatype for some strange reason you can do it like this:

function is(type, obj) {
    var clas = Object.prototype.toString.call(obj).slice(8, -1);
    return obj !== undefined && obj !== null && clas === type;
}

//basic usage
is('String', 'test'); // true
is('Array', true); // false
//Or compare it against any type you want