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

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.

主站蜘蛛池模板: 周宁县| 江陵县| 灵台县| 开平市| 沙坪坝区| 锡林郭勒盟| 兴和县| 民勤县| 新蔡县| 枝江市| 保德县| 高清| 贵德县| 和平县| 江油市| 长沙县| 习水县| 民县| 开化县| 嘉荫县| 探索| 宜城市| 黄陵县| 东至县| 房山区| 建始县| 九龙县| 福建省| 泰安市| 南华县| 胶州市| 巴南区| 保亭| 铜梁县| 富源县| 彭水| 班玛县| 民乐县| 曲沃县| 五常市| 米林县|