Javascript is loosely typed language, so a variable can be used without declaring its type. Javascript determines the data type on the basis of data stored in the variable. Hence, same variable can be of different types in different scenarios.

Example

<script>
 var a  = 10;		//Here, a is integer
 var a = "Hello";	//Here, a is string
 var a = true;		//Here, a is boolean
</script>

Firstly variable a holds an integer value which is 10, then again same variable holds string value, again it holds a Boolean value. This way same variable can be used for different purpose.