Var a = “String” + 5 // ‘+’ symbol is used for concatenation in javascript Javascript has some own rules for converting the data type implicitly. This does not give an error in javascript, we can explicitly change the data type of variable. But in the next line, we assign a string value. Here at first, we have assigned an integer in variable ‘ a’ so it takes an integer as its data type. In Javascript, we can also explicitly change the data type of a variable. Here we have assigned an integer, so it will take an integer as its data type. Javascript provides dynamic data types (it is loosely typed language), it means we don’t need to define the type (whether it is integer or string), whatever we assign at the time of assignment it accepts its type as its data type. Javascript holds a variety of data types that are easy to use. Data types and objects are the basic keywords that are required by any language.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |