
本文共 3869 字,大约阅读时间需要 12 分钟。
��������� ������������������
5.1 Date
ECMAScript ��� Date ��������������� Java ������������������ java.util.Date
���Date ���������������������������������������������UTC���Universal Time Coordinated��������� 1970 ��� 1 ��� 1 ������������������������������������������������������������������������ Date ������������������������ 1970 ��� 1 ��� 1 ��������������������� 285 616 ���������������
������������������
������ new
��������������� Date ������������������������������������������������������������������������������������������������������������������������������������������������������ Date.parse()
��� Date.UTC()
���������
Date.parse()
Date.parse()
��������������������������������������������������������������������������������������������������������������������������������� NaN
��������������������������������� Date ������������������Date Methods ��������������� Date.parse()
���
Date.UTC()
Date.UTC()
������������������������������������������������������������������������������������������ 0 ��������������������������������������������������������������������������������������� 0��������������������������� Date.UTC()
������ GMT ������������������������
���������������������
Date.UTC()
��������������������������������������������� GMT ���������
Date.now()
Date.now()
��������������������� UNIX ���������1970 ��� 1 ��� 1 ��� 00:00:00 UTC���������������������������������������������������������������������
���������������
Date ��������������� toLocaleString()
���toString()
��� valueOf()
���������������������������������������������������������������������������������������������������valueOf()
���������������������������������������������
���������������������
Date ������������������������������������������������������ getDate()
���getMonth()
���getYear()
������
5.2 RegExp
ECMAScript ������ RegExp
������������������������������������������������������������������������������������ RegExp ���������������������
������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������
- ������������ (g)���������������������������
- ������������������ (i)���������������������
- ������������ (m)������������������������������������
- ������������ (y)���������
lastIndex
��������������� - Unicode ������ (u)��������� Unicode ��������� -DotAll ������ (s)������
.
���������������������
������ RegExp ������������
Construct������������������������������������������������������������������������ RegExp ������������������������������
RegExp ������������
RegExp ������������������������������������ global
���ignoreCase
���unicode
���������������������������������������������������������
RegExp ������������
exec()
������������������������������test()
���������������������������������������������������������������������������������������toLocalString()
���toString()
��� valueOf()
������������������������������������������������
5.3 ���������������������
ECMAScript ������ Boolean
���Number
��� String
���������������������������������������������������������������������������������������������
let s1 = "some text";let s2 = s1.substring(2); // "me text"
������������������������������������ String
���������������������������������������������
Boolean
let booleanObject = new Boolean(true);// ������ `valueOf()` ������ `true`���`toString()` ������ "true"���
Number
let numberObject = new Number(10);// `valueOf()` ������ 10���`toString()` ������ "10"���
String
let stringObject = new String("hello world");// `substring()` ������������������������������������
5.4 ������������
Global
Global ������������������������ URL ���������������������������
Math
Math ��������������������������������������� min()
���max()
���ceil()
���floor()
������random()
���������������������������
Date
Date ���������������������������������������������
发表评论
最新留言
关于作者
