var x= "str";
console.log(typeof x) //Output String
console.log(typeof x) //Output int
float number is also consider as number.
3. If a variable is not defined anywhere only assigned a value inside function it is assume global by default and it can be accessed outside function
4. According to point 3 it can create problem so avoid this we use 'use strict'. By using this line we can not use a variable without defining it.
This will give error. 'x' is not defined. So in this way x can not be used without defining it so while we define it, it will be local. So can not be used outside F1.
5. In java script declaration is pulled up.
it will run and give message undefined.
Though above code will run so no message will appear. And error will be there.
6. Immediate invoking function