I'm new to JavaScript and is writing a simple website using Netbeans. Since JavaScript is dynamically typed language, I was wondering how can I find out the type of a variable in situations where I am unsure of.
For example, how can I find out the variable type of emailAddress
or domainPart
in the code below?
function getEmailAndDomainParts(){
var emailAddress = document.getElementById("EmailAddress").value;
var emailPart = emailAddress.substring(0, emailAddress.indexOf("@"));
var domainPart = emailAddress.substring(emailAddress.indexOf("@") + 1);
document.getElementById("Email").value = emailPart;
document.getElementById("Domain").value = domainPart;
}