官术网_书友最值得收藏!

Data types

Data types are the base of any language. The data types available in JavaScript are
as follows:

  • Number
  • String
  • Boolean
  • Object
  • Null
  • Undefined
  • Symbol (new in es6)

In our code, every variable we declare will contain values that belong to any of the preceding types. Number, String, and Boolean types are quite straightforward to understand. These comes under the primitive data types supported by the language. Here, one important point is to note that JavaScript has no distinction between integers or floating points at its type level.

Types such as array, function, regex, and date come under the object data type.
They are considered to be composite data types. So the functions that you define
in your code will also be nothing but objects.

Null and undefined are two special types supported by JavaScript. Null points
to a deliberate non-value, whereas undefined points to an uninitialized value. So, when you just declare a variable and haven't yet initialized it with a value, the variable will be of undefined type. Last but not least, es6 has introduced a new primitive data type of symbol. They are used for unique property keys and constants representative concepts.

We are not using them in context of our book, however you can visit the following link for more details http://exploringjs.com/es6/ch_symbols.html.

So before we understand various ways to define functions, arrays, and objects, lets go through operators and flows.

主站蜘蛛池模板: 容城县| 拜城县| 工布江达县| 桐城市| 广饶县| 东港市| 木里| 敦煌市| 曲松县| 恩平市| 临桂县| 固阳县| 隆子县| 兴和县| 靖西县| 高平市| 赫章县| 章丘市| 乌拉特后旗| 云南省| 深泽县| 永顺县| 武汉市| 西宁市| 乐亭县| 搜索| 呼伦贝尔市| 榆树市| 肥西县| 隆林| 柳林县| 枞阳县| 肇东市| 体育| 乌拉特后旗| 嘉义市| 常宁市| 龙泉市| 花莲市| 驻马店市| 乌兰浩特市|