String, Number, Boolean, Array, Object, Null, Undefined ).
JavaScript Data Type
String, Number, Boolean, Array, Object, Null, Undefined ).
JavaScript has dynamic types
JavaScript has dynamic types. This means that the same variables can be of different types:
Instance
Var x; // x is undefinedvar x = 5; // now x is a number var x = "John"; // now x is a string
JavaScript string
A string is a variable that stores characters (such as "Bill Gates.
A string can be any text in quotation marks. You can use single or double quotation marks:
Instance
var carname="Volvo XC60";var carname='Volvo XC60';
You can use quotation marks in a string as long as they do not match the quotation marks surrounding the string:
Instance
var answer="It's alright";var answer="He is called 'Johnny'";var answer='He is called "Johnny"';
You will learn in the advanced section of this tutorial